/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modulos.consulta.vista;

import basedatos.ConsultaBD;
import basedatos.ConsultaVisualizarBD;
import basedatos.EvolucionBD;
import basedatos.OperacionesBD;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import modelo.NumeroLetra;
import modelo.Persona;
import modelo.Pyme;
import modulos.agenda.vista.iFrmAgenda;
import modulos.certificado.vista.iFrmCertificadoMedico;
import modulos.consulta.modelo.*;
import modulos.enfymed.modelo.MedicamentoComercial;
import modulos.enfymed.modelo.Patologia;
import modulos.examenes.vista.iFrmExamenes;
import modulos.paciente.modelo.Paciente;
import modulos.reservacion.vista.iFrmReservaCita;
import modulos.usuario.modelo.Usuario;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
import net.sf.jasperreports.engine.util.JRLoader;
import net.sf.jasperreports.view.JasperViewer;
import vista.frmPrincipal;
import vista.modelo.Calendario;
import vista.modelo.OperacionesVarias;

/**
 *
 * @author Edulima
 */
public class IFrmHCGeneral extends javax.swing.JInternalFrame {

    /**
     * Creates new form IFrmHCGeneral
     */
    private Usuario usuario = new Usuario();
    private Paciente paciente = new Paciente();
    private Consulta consulta = new Consulta();
    private Evolucion evolucion = new Evolucion();
    private ArrayList<Object> listConsultas = new ArrayList<Object>();
    private ArrayList<Object> listEvoluciones = new ArrayList<Object>();
    private ArrayList<Object> listMedicamentos = new ArrayList<Object>();
    private ArrayList<Object> listPatologias = new ArrayList<Object>();
    private static ArrayList<Object> listMotivoConsultas = new ArrayList<Object>();
    private DefaultTableModel modelotblConsultas = new DefaultTableModel();
    private DefaultTableModel modelotblEvoluciones = new DefaultTableModel();
    private ArrayList<pnlDiagnostico> pnlsDiagnosticos = new ArrayList<pnlDiagnostico>();
    //consultas otros especialistas
    private DefaultTableModel modelotblConsultasVisualizar = new DefaultTableModel();
    private DefaultTableModel modelotblEvolucionesVisualizar = new DefaultTableModel();
    private ArrayList<ConsultaVisualizar> listConsultasVisualizar = new ArrayList<ConsultaVisualizar>();
    private ArrayList<Evolucion> listEvolucionesVisualizar = new ArrayList<Evolucion>();
    private ConsultaVisualizar consultaVisualizar = new ConsultaVisualizar();
    //Declaracion de Constantes
    public static final int NEW_CONSULTA = 0;
    public static final int VIEW_CONSULTA = 1;
    public static final int NEW_EVOLUCION = 2;
    public static final int VIEW_EVOLUCION = 3;
    public static final int NULO = -1;
    private int estadoForm;

    public IFrmHCGeneral() {
        initComponents();
        usuario = (Usuario) frmPrincipal.UsuarioLogueado.get(0)[1];
        listConsultas = (ArrayList<Object>) ConsultaBD.listarConsultas(paciente, usuario);

        OperacionesVarias.centrar(this);
    }

    public IFrmHCGeneral(Paciente paciente) {
        initComponents();
        usuario = (Usuario) frmPrincipal.UsuarioLogueado.get(0)[1];
        listConsultas = (ArrayList<Object>) ConsultaBD.listarConsultas(paciente, usuario);

        modelotblConsultas.addColumn("Nro");
        modelotblConsultas.addColumn("Motivo Consulta");
        modelotblConsultas.addColumn("Fecha");
        modelotblEvoluciones.addColumn("Nro");
        modelotblEvoluciones.addColumn("Evolucion");
        modelotblEvoluciones.addColumn("Fecha");
        modelotblConsultasVisualizar.addColumn("Nro");
        modelotblConsultasVisualizar.addColumn("Especialista");
        modelotblConsultasVisualizar.addColumn("Motivo Consulta");
        modelotblConsultasVisualizar.addColumn("Fecha");
        modelotblEvolucionesVisualizar.addColumn("Nro");
        modelotblEvolucionesVisualizar.addColumn("Evolucion");
        modelotblEvolucionesVisualizar.addColumn("Fecha");

        listarMedicamentos();
        listarPatologias();
        listarMotivoConsultas();
        tpnlPaneles.removeAll();
        this.paciente = paciente;
        setPaciente(paciente);
        btnCerrarConsulta.setVisible(false);
        OperacionesVarias.centrar(this);
        pnlDiagnostico pnlD = new pnlDiagnostico();
        pnlDiagnosticos.add(pnlD);
        pnlsDiagnosticos.add(pnlD);
        setEstadoForm(IFrmHCGeneral.NULO);
    }

    private void agregarPaneles() {
        tpnlPaneles.removeAll();
        tpnlPaneles.add(pnlAnamnesis);
        tpnlPaneles.add(pnlExamenFisico);
        tpnlPaneles.add(pnlDiagReceta);
        tpnlPaneles.setTitleAt(0, "Anamnesis");
        tpnlPaneles.setTitleAt(1, "Examen Fisico");
        tpnlPaneles.setTitleAt(2, "Diagnostico/Receta");
    }

    private void setPaciente(Paciente p) {
        txtNomPacient.setText(p.getNombre() + " " + p.getApellido());
        txtEdadPacient.setText(Persona.calcularAnos(p.getFechaNace()));
        txtNumHC.setText(p.getNumeroHC());

        cargarConsultas();
        tblConsultas.getColumnModel().getColumn(0).setPreferredWidth(15);
        tblConsultas.getColumnModel().getColumn(1).setPreferredWidth(220);
        tblConsultas.getColumnModel().getColumn(2).setPreferredWidth(120);
        tblConsultas.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);

        tblEvoluciones.getColumnModel().getColumn(0).setPreferredWidth(15);
        tblEvoluciones.getColumnModel().getColumn(1).setPreferredWidth(220);
        tblEvoluciones.getColumnModel().getColumn(2).setPreferredWidth(120);
        tblEvoluciones.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
        tpnlPaneles.add(pnlConsultas);
        tpnlPaneles.setTitleAt(0, "Listado de Consultas");

    }

    private void newConsulta() {
        consulta = new Consulta();
        txtAntecedentFami.setText("");
        txtAntecedentPerson.setText("");
        txtEnfermedadActual.setText("");
        txtMotivoConsulta.setText("");
        int num = (listConsultas.size() + 1);
        txtNumConsulta.setText("" + num);
        consulta.setNumConsul(num);
        GregorianCalendar c = new GregorianCalendar();
        String dia = Calendario.diasCalendario[c.get(GregorianCalendar.DAY_OF_WEEK) - 1];
        txtFecha.setText(dia + ", " + OperacionesVarias.fechaString(c.getTime()));
        txtHora.setText(c.get(GregorianCalendar.HOUR) + ":" + c.get(GregorianCalendar.MINUTE) + ":" + c.get(GregorianCalendar.SECOND));
        consulta.setFechaCreacion(c.getTime());
        txtAnexoDR.setText("");
        txtIndicacionDR.setText("");
        txtMedicamentosDR.setText("");
        pnlDiagnosticos.removeAll();
        pnlsDiagnosticos = new ArrayList<pnlDiagnostico>();
        pnlsDiagnosticos.add(new pnlDiagnostico());
        pnlDiagnosticos.add(pnlsDiagnosticos.get(pnlsDiagnosticos.size() - 1));
        btnCerrarConsulta.setVisible(true);
        btnNewEvolucion.setEnabled(false);
        btnNewConsulta.setEnabled(false);
        setEstadoForm(IFrmHCGeneral.NEW_CONSULTA);
        setEditable(true);
    }

    private void newEvolucion() {
        evolucion = new Evolucion();
        evolucion.setNumEvolucion(listEvoluciones.size() + 1);
        GregorianCalendar c = new GregorianCalendar();
        String dia = Calendario.diasCalendario[c.get(GregorianCalendar.DAY_OF_WEEK) - 1];
        txtFechaEvolucion.setText(dia + ", " + OperacionesVarias.fechaString(c.getTime()));
        txtHoraEvolucion.setText(c.get(GregorianCalendar.HOUR) + ":" + c.get(GregorianCalendar.MINUTE) + ":" + c.get(GregorianCalendar.SECOND));
        evolucion.setFechaCreacion(c.getTime());
        setEstadoForm(IFrmHCGeneral.NEW_EVOLUCION);
        txtEvolucion.setText("");
        txtMedicamentosE.setText("");
        txtIndicacionesE.setText("");
        setEditableEvolucion(true);
        tpnlPaneles.add(pnlEvolucion);
        tpnlPaneles.setTitleAt(tpnlPaneles.getTabCount() - 1, "Evolucion");
        tpnlPaneles.setSelectedIndex(tpnlPaneles.getTabCount() - 1);
    }

    private Consulta getConsulta(Consulta consulta) {
        consulta.setAntecedent_Fami(txtAntecedentFami.getText());
        consulta.setAntecedent_Person(txtAntecedentPerson.getText());
        consulta.setEnfermedadActual(txtEnfermedadActual.getText());

        //Datos Diagnostico y Receta
        consulta.getRecetaMedica().setMedicamentos(txtMedicamentosDR.getText());
        consulta.getRecetaMedica().setIndicaciones(txtIndicacionDR.getText());
        consulta.getDiagnosticos().clear();
        for (pnlDiagnostico panel : pnlsDiagnosticos) {
            Diagnostico diag = new Diagnostico();
            diag.setDiagnostico(panel.getDiagnostico());
            diag.setTipo(panel.getSeleccion());
            diag.setIdDiagnostico(panel.getIdDiagnostico());
            consulta.getDiagnosticos().add(diag);
        }
        consulta.setAnexos(txtAnexoDR.getText());

        //Datos Examen Fisico
        consulta.getExamenFisico().settA(txtTa.getText());
        consulta.getExamenFisico().setfC(txtFc.getText());
        consulta.getExamenFisico().setfR(txtFr.getText());
        consulta.getExamenFisico().setSat02(txtSat02.getText());
        consulta.getExamenFisico().setLlenadocapilar(txtLlenadoCapilar.getText());
        consulta.getExamenFisico().setGlicemia(txtGlicemia.getText());
        consulta.getExamenFisico().setTemperatura(txtTemperatura.getText());
        try {
            consulta.getExamenFisico().setPeso(Double.parseDouble(txtPeso.getText()));
            consulta.getExamenFisico().setTalla(Integer.parseInt(txtTalla.getText()));
        } catch (NumberFormatException e) {
        }
        consulta.getExamenFisico().setBiotipoConst(cmbBiotipoConst.getSelectedItem().toString());
        consulta.getExamenFisico().setPsicoexpresiva(txtPsicoexpresiva.getText());
        consulta.getExamenFisico().setSomatoexpresiva(txtSomatoexpresiva.getText());
        consulta.getExamenFisico().setEstadoNutricional(cmbEstadoNutri.getSelectedItem().toString());

        //Usuario
        consulta.setUsuario(usuario);
        consulta.setPaciente(paciente);
        return consulta;
    }

    private Evolucion getEvolucion(Evolucion evolucion) {
        evolucion.setEvolucion(txtEvolucion.getText());
        evolucion.getRecetaMedica().setIndicaciones(txtIndicacionesE.getText());
        evolucion.getRecetaMedica().setMedicamentos(txtMedicamentosE.getText());
        evolucion.setConsulta(consulta);
        return evolucion;
    }

    private void listarMedicamentos() {
        listMedicamentos = (ArrayList<Object>) OperacionesBD.listarPorUsuario("MedicamentoComercial",usuario);
        for (Object aux : listMedicamentos) {
            cmbMedicamentoDR.addItem((MedicamentoComercial) aux);
            cmbMedicamentoE.addItem((MedicamentoComercial) aux);
        }
    }

    private void listarPatologias() {
        listPatologias = (ArrayList<Object>) OperacionesBD.listarPorUsuario("Patologia",usuario);
        for (Object aux : listPatologias) {
            cmbPatologiaDR.addItem(((Patologia) aux).getNombrePatologia());
            cmbPatologiaE.addItem(((Patologia) aux).getNombrePatologia());
        }
    }

    public static void listarMotivoConsultas() {
        listMotivoConsultas = (ArrayList<Object>) OperacionesBD.listar("Motivo_Consulta");
        cmbMotivoConsulta.removeAllItems();
        for (Object aux : listMotivoConsultas) {
            cmbMotivoConsulta.addItem(((Motivo_Consulta) aux).getMotivo());
        }
    }

    private void cargarConsultas() {
        btnCerrarConsulta.setVisible(false);

        int c = modelotblConsultas.getRowCount();
        try {
            for (int i = 0; i < c; i++) {
                modelotblConsultas.removeRow(0);
            }

        } catch (Exception ex) {
            ex.getMessage();
        }

        listConsultas = (ArrayList<Object>) ConsultaBD.listarConsultas(paciente, usuario);
        for (Object obj : listConsultas) {
            Consulta consul = (Consulta) obj;
            Object[] aux = {consul.getNumConsul(),
                consul.getMotivo_Consulta(),
                OperacionesVarias.fechaString(consul.getFechaCreacion())
            };
            modelotblConsultas.addRow(aux);
        }

        //consultas visualizar
        c = modelotblConsultasVisualizar.getRowCount();
        try {
            for (int i = 0; i < c; i++) {
                modelotblConsultasVisualizar.removeRow(0);
            }

        } catch (Exception ex) {
            ex.getMessage();
        }
        listConsultasVisualizar = (ArrayList<ConsultaVisualizar>) ConsultaVisualizarBD.listar(usuario);
        for (ConsultaVisualizar consul : listConsultasVisualizar) {
            Object[] aux = {consul.getConsulta().getNumConsul(),
                consul.getConsulta().getUsuario(),
                consul.getConsulta().getMotivo_Consulta(),
                OperacionesVarias.fechaString(consul.getConsulta().getFechaCreacion())
            };
            modelotblConsultasVisualizar.addRow(aux);
        }
    }

    private void cargarEvoluciones() {
        btnCerrarConsulta.setVisible(false);
        int c = modelotblEvoluciones.getRowCount();
        try {
            for (int i = 0; i < c; i++) {
                modelotblEvoluciones.removeRow(0);
            }

        } catch (Exception ex) {
            ex.getMessage();
        }

        listEvoluciones = (ArrayList<Object>) EvolucionBD.listarEvoluciones(consulta);
        for (Object obj : listEvoluciones) {
            Evolucion evol = (Evolucion) obj;
            Object[] aux1 = {evol.getNumEvolucion(),
                evol.getEvolucion(),
                OperacionesVarias.fechaString(evol.getFechaCreacion())
            };
            modelotblEvoluciones.addRow(aux1);
        }
    }

    private void cargarEvolucionesVisualizar() {
        btnCerrarConsulta.setVisible(false);
        int c = modelotblEvolucionesVisualizar.getRowCount();
        try {
            for (int i = 0; i < c; i++) {
                modelotblEvolucionesVisualizar.removeRow(0);
            }

        } catch (Exception ex) {
            ex.getMessage();
        }

        listEvolucionesVisualizar = (ArrayList<Evolucion>) EvolucionBD.listarEvoluciones(consultaVisualizar.getConsulta());
        for (Evolucion evol : listEvolucionesVisualizar) {
            Object[] aux1 = {evol.getNumEvolucion(),
                evol.getEvolucion(),
                OperacionesVarias.fechaString(evol.getFechaCreacion())
            };
            modelotblEvolucionesVisualizar.addRow(aux1);
        }
    }

    private void setConsulta(Consulta consul) {
        txtMotivoConsulta.setText("");
        for (int i = 0; i < consul.getMotivo_Consulta().size(); i++) {
            txtMotivoConsulta.setText(txtMotivoConsulta.getText() + (i + 1) + ".- " + consul.getMotivo_Consulta().get(i) + "    ");
        }
        txtNumConsulta.setText("" + consulta.getNumConsul());
        txtEnfermedadActual.setText(consul.getEnfermedadActual());
        GregorianCalendar c = new GregorianCalendar();
        c.setTime(consul.getFechaCreacion());
        String dia = Calendario.diasCalendario[c.get(GregorianCalendar.DAY_OF_WEEK) - 1];
        txtFecha.setText(dia + ", " + OperacionesVarias.fechaString(c.getTime()));
        txtHora.setText(c.get(GregorianCalendar.HOUR) + ":" + c.get(GregorianCalendar.MINUTE) + ":" + c.get(GregorianCalendar.SECOND));
        txtAntecedentFami.setText(consul.getAntecedent_Fami());
        txtAntecedentPerson.setText(consul.getAntecedent_Person());
        txtTemperatura.setText(consulta.getExamenFisico().getTemperatura());

        //Datos Diagnostico y  Receta Medica
        txtMedicamentosDR.setText(consul.getRecetaMedica().getMedicamentos());
        txtIndicacionDR.setText(consul.getRecetaMedica().getIndicaciones());
        pnlDiagnosticos.removeAll();
        pnlsDiagnosticos = new ArrayList<pnlDiagnostico>();

        for (Diagnostico diag : consul.getDiagnosticos()) {
            pnlDiagnostico pnl = new pnlDiagnostico();
            pnl.setDiagnostico(diag.getDiagnostico());
            pnl.setSeleccion(diag.getTipo());
            pnl.setIdDiagnostico(diag.getIdDiagnostico());
            pnlsDiagnosticos.add(pnl);
            pnlDiagnosticos.add(pnlsDiagnosticos.get(pnlsDiagnosticos.size() - 1));
        }
        txtAnexoDR.setText(consul.getAnexos());

        //Datos Examen Fisico
        txtTa.setText(consul.getExamenFisico().gettA());
        txtFc.setText(consul.getExamenFisico().getfC());
        txtFr.setText(consul.getExamenFisico().getfR());
        txtSat02.setText(consul.getExamenFisico().getSat02());
        txtLlenadoCapilar.setText(consul.getExamenFisico().getLlenadocapilar());
        txtGlicemia.setText(consul.getExamenFisico().getGlicemia());
        txtPeso.setText("" + consul.getExamenFisico().getPeso());
        txtTalla.setText("" + consul.getExamenFisico().getTalla());
        cmbBiotipoConst.setSelectedItem(consul.getExamenFisico().getBiotipoConst());
        txtPsicoexpresiva.setText(consul.getExamenFisico().getPsicoexpresiva());
        txtSomatoexpresiva.setText(consul.getExamenFisico().getSomatoexpresiva());
        cmbEstadoNutri.setSelectedItem(consul.getExamenFisico().getEstadoNutricional());
        txtImc.setText("" + calcularIMC(txtTalla.getText(), txtPeso.getText()));
        setEstadoForm(IFrmHCGeneral.VIEW_CONSULTA);
    }

    private void setEvolucion(Evolucion evolu) {
        GregorianCalendar c = new GregorianCalendar();
        c.setTime(evolu.getFechaCreacion());
        String dia = Calendario.diasCalendario[c.get(GregorianCalendar.DAY_OF_WEEK) - 1];
        txtFechaEvolucion.setText(dia + ", " + OperacionesVarias.fechaString(c.getTime()));
        txtHoraEvolucion.setText(c.get(GregorianCalendar.HOUR) + ":" + c.get(GregorianCalendar.MINUTE) + ":" + c.get(GregorianCalendar.SECOND));
        evolucion.setFechaCreacion(c.getTime());
        txtEvolucion.setText(evolu.getEvolucion());
        txtMedicamentosE.setText(evolu.getRecetaMedica().getMedicamentos());
        txtIndicacionesE.setText(evolu.getRecetaMedica().getIndicaciones());
        tpnlPaneles.removeAll();
        tpnlPaneles.add(pnlEvolucion);
        tpnlPaneles.setTitleAt(tpnlPaneles.getTabCount() - 1, "Evolucion");
        setEstadoForm(IFrmHCGeneral.VIEW_CONSULTA);
    }

    private BigDecimal calcularIMC(String tall, String pes) {
        BigDecimal big = new BigDecimal("0");
        try {
            double talla = Integer.parseInt(tall);
            double num1 = Math.pow((talla / 100), 2);
            double peso = Double.parseDouble(pes);
            double resp = (peso / num1);
            big = new BigDecimal(resp);
            big = big.setScale(2, RoundingMode.HALF_UP);
        } catch (NumberFormatException e) {
        }
        return big;
    }

    private void setEditable(boolean esEditable) {
        cmbMotivoConsulta.setEnabled(esEditable);
        btnAddMotivoConsul.setEnabled(esEditable);
        btnAgregarMotivoConsulta.setEnabled(esEditable);
        txtMotivoConsulta.setEditable(esEditable);
        txtEnfermedadActual.setEditable(esEditable);
        txtAntecedentFami.setEditable(esEditable);
        txtAntecedentPerson.setEditable(esEditable);

        //Diagnostico-Receta
        for (pnlDiagnostico pnl : pnlsDiagnosticos) {
            pnl.getTxt().setEnabled(esEditable);
            pnl.getRbtnDefinitivo().setEnabled(esEditable);
            pnl.getRbtnPresuntivo().setEnabled(esEditable);
        }
        txtAnexoDR.setEditable(esEditable);
        cmbMedicamentoDR.setEnabled(esEditable);
        cmbPatologiaDR.setEnabled(esEditable);
        txtCantidadMedicamentosDR.setEditable(esEditable);
        btnAgregarMedicamentoDR.setEnabled(esEditable);
        btnAgregarPatologiaDR.setEnabled(esEditable);
        txtMedicamentosDR.setEditable(esEditable);
        txtIndicacionDR.setEditable(esEditable);
        btnAgregarDR.setEnabled(esEditable);
        btnGuardarConsulta.setEnabled(esEditable);
        btnImprimirReceta.setEnabled(esEditable);

        //Examen Fisico
        txtTa.setEditable(esEditable);
        txtFc.setEditable(esEditable);
        txtFr.setEditable(esEditable);
        txtTemperatura.setEditable(esEditable);
        cmbTemperatura.setEnabled(esEditable);
        txtSat02.setEditable(esEditable);
        txtLlenadoCapilar.setEditable(esEditable);
        txtGlicemia.setEditable(esEditable);
        txtPeso.setEditable(esEditable);
        txtTalla.setEditable(esEditable);
        cmbBiotipoConst.setEnabled(esEditable);
        txtPsicoexpresiva.setEditable(esEditable);
        txtSomatoexpresiva.setEditable(esEditable);
        cmbEstadoNutri.setEnabled(esEditable);
    }

    private void setEditableEvolucion(boolean esEditable) {
        txtEvolucion.setEditable(esEditable);
        cmbMedicamentoE.setEnabled(esEditable);
        cmbPatologiaE.setEnabled(esEditable);
        txtCantidadMedicamentosE.setEditable(esEditable);
        btnAgregarMedicamentoE.setEnabled(esEditable);
        btnAgregarPatologiaE.setEnabled(esEditable);
        txtMedicamentosE.setEditable(esEditable);
        txtIndicacionesE.setEditable(esEditable);
        btnGuardarEvolucion.setEnabled(esEditable);
        btnImprimirEvolucion.setEnabled(esEditable);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlConsultas = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jLabel49 = new javax.swing.JLabel();
        jScrollPane11 = new javax.swing.JScrollPane();
        tblEvoluciones = new JTable() {
            public boolean isCellEditable(int rowIndex, int vColIndex) {
                return false;
            }
        };
        jLabel48 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tblConsultas = new JTable() {
            public boolean isCellEditable(int rowIndex, int vColIndex) {
                return false;
            }
        };
        jScrollPane13 = new javax.swing.JScrollPane();
        tblConsultasVisualizar = new JTable() {
            public boolean isCellEditable(int rowIndex, int vColIndex) {
                return false;
            }
        };
        jLabel50 = new javax.swing.JLabel();
        jScrollPane14 = new javax.swing.JScrollPane();
        tblEvolucionesVisualizar = new JTable() {
            public boolean isCellEditable(int rowIndex, int vColIndex) {
                return false;
            }
        };
        jLabel51 = new javax.swing.JLabel();
        jPopupMenu1 = new javax.swing.JPopupMenu();
        mnConsultaVisualizacion = new javax.swing.JMenuItem();
        tpnlPaneles = new javax.swing.JTabbedPane();
        pnlAnamnesis = new javax.swing.JPanel();
        pnlId = new javax.swing.JPanel();
        txtMotivoConsulta = new javax.swing.JTextField();
        cmbMotivoConsulta = new javax.swing.JComboBox();
        btnAgregarMotivoConsulta = new javax.swing.JButton();
        btnAddMotivoConsul = new javax.swing.JButton();
        pnlId1 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        txtEnfermedadActual = new javax.swing.JTextArea();
        pnlId2 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        jScrollPane6 = new javax.swing.JScrollPane();
        txtAntecedentPerson = new javax.swing.JTextArea();
        jPanel5 = new javax.swing.JPanel();
        jLabel23 = new javax.swing.JLabel();
        jScrollPane7 = new javax.swing.JScrollPane();
        txtAntecedentFami = new javax.swing.JTextArea();
        pnlDiagReceta = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jPanel12 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        pnlDiagnosticos = new javax.swing.JPanel();
        btnAgregarDR = new javax.swing.JButton();
        jPanel13 = new javax.swing.JPanel();
        jPanel14 = new javax.swing.JPanel();
        jLabel27 = new javax.swing.JLabel();
        jScrollPane8 = new javax.swing.JScrollPane();
        txtIndicacionDR = new javax.swing.JTextArea();
        jScrollPane9 = new javax.swing.JScrollPane();
        txtMedicamentosDR = new javax.swing.JTextArea();
        jLabel28 = new javax.swing.JLabel();
        jPanel15 = new javax.swing.JPanel();
        cmbPatologiaDR = new javax.swing.JComboBox();
        cmbMedicamentoDR = new javax.swing.JComboBox();
        jLabel19 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        btnAgregarPatologiaDR = new javax.swing.JButton();
        btnAgregarMedicamentoDR = new javax.swing.JButton();
        txtCantidadMedicamentosDR = new javax.swing.JTextField();
        btnGuardarConsulta = new javax.swing.JButton();
        btnImprimirReceta = new javax.swing.JButton();
        jScrollPane10 = new javax.swing.JScrollPane();
        txtAnexoDR = new javax.swing.JTextArea();
        pnlEvolucion = new javax.swing.JPanel();
        btnGuardarEvolucion = new javax.swing.JButton();
        btnImprimirEvolucion = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jScrollPane12 = new javax.swing.JScrollPane();
        txtEvolucion = new javax.swing.JTextArea();
        txtFechaEvolucion = new javax.swing.JLabel();
        txtHoraEvolucion = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        jLabel20 = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        txtIndicacionesE = new javax.swing.JTextArea();
        jScrollPane3 = new javax.swing.JScrollPane();
        txtMedicamentosE = new javax.swing.JTextArea();
        jLabel21 = new javax.swing.JLabel();
        jPanel11 = new javax.swing.JPanel();
        btnAgregarPatologiaE = new javax.swing.JButton();
        cmbPatologiaE = new javax.swing.JComboBox();
        cmbMedicamentoE = new javax.swing.JComboBox();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        btnAgregarMedicamentoE = new javax.swing.JButton();
        txtCantidadMedicamentosE = new javax.swing.JTextField();
        pnlExamenFisico = new javax.swing.JPanel();
        pnlId3 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        txtTa = new javax.swing.JTextField();
        txtFc = new javax.swing.JTextField();
        txtFr = new javax.swing.JTextField();
        txtTemperatura = new javax.swing.JTextField();
        cmbTemperatura = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        txtGlicemia = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        txtSat02 = new javax.swing.JTextField();
        jLabel36 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        txtLlenadoCapilar = new javax.swing.JTextField();
        pnlId4 = new javax.swing.JPanel();
        jLabel38 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        jLabel41 = new javax.swing.JLabel();
        jLabel42 = new javax.swing.JLabel();
        txtPeso = new javax.swing.JTextField();
        txtTalla = new javax.swing.JTextField();
        txtImc = new javax.swing.JTextField();
        pnlId5 = new javax.swing.JPanel();
        jLabel43 = new javax.swing.JLabel();
        jLabel45 = new javax.swing.JLabel();
        jLabel47 = new javax.swing.JLabel();
        cmbBiotipoConst = new javax.swing.JComboBox();
        cmbEstadoNutri = new javax.swing.JComboBox();
        jLabel44 = new javax.swing.JLabel();
        jLabel46 = new javax.swing.JLabel();
        txtPsicoexpresiva = new javax.swing.JTextField();
        txtSomatoexpresiva = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        pnlId6 = new javax.swing.JPanel();
        jScrollPane15 = new javax.swing.JScrollPane();
        txtEnfermedadActual1 = new javax.swing.JTextArea();
        pnlId7 = new javax.swing.JPanel();
        jScrollPane16 = new javax.swing.JScrollPane();
        txtEnfermedadActual2 = new javax.swing.JTextArea();
        pnlId8 = new javax.swing.JPanel();
        jScrollPane17 = new javax.swing.JScrollPane();
        txtEnfermedadActual3 = new javax.swing.JTextArea();
        pnlId9 = new javax.swing.JPanel();
        jScrollPane18 = new javax.swing.JScrollPane();
        txtEnfermedadActual4 = new javax.swing.JTextArea();
        pnlId10 = new javax.swing.JPanel();
        jScrollPane19 = new javax.swing.JScrollPane();
        txtEnfermedadActual5 = new javax.swing.JTextArea();
        jPanel3 = new javax.swing.JPanel();
        pnlId11 = new javax.swing.JPanel();
        jScrollPane20 = new javax.swing.JScrollPane();
        txtEnfermedadActual6 = new javax.swing.JTextArea();
        pnlId12 = new javax.swing.JPanel();
        jScrollPane21 = new javax.swing.JScrollPane();
        txtEnfermedadActual7 = new javax.swing.JTextArea();
        jLabel52 = new javax.swing.JLabel();
        jLabel53 = new javax.swing.JLabel();
        jScrollPane25 = new javax.swing.JScrollPane();
        txtEnfermedadActual11 = new javax.swing.JTextArea();
        jScrollPane26 = new javax.swing.JScrollPane();
        txtEnfermedadActual12 = new javax.swing.JTextArea();
        pnlId13 = new javax.swing.JPanel();
        jScrollPane22 = new javax.swing.JScrollPane();
        txtEnfermedadActual8 = new javax.swing.JTextArea();
        pnlId14 = new javax.swing.JPanel();
        jScrollPane23 = new javax.swing.JScrollPane();
        txtEnfermedadActual9 = new javax.swing.JTextArea();
        pnlId15 = new javax.swing.JPanel();
        jScrollPane24 = new javax.swing.JScrollPane();
        txtEnfermedadActual10 = new javax.swing.JTextArea();
        pnlId17 = new javax.swing.JPanel();
        jScrollPane28 = new javax.swing.JScrollPane();
        txtEnfermedadActual14 = new javax.swing.JTextArea();
        pnlBotones = new javax.swing.JPanel();
        btnNewEvolucion = new javax.swing.JButton();
        btnImprimirHC = new javax.swing.JButton();
        btnNewConsulta = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        btnViewDatosPersonales = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        btnExamenes = new javax.swing.JButton();
        pnlEmcabezado = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        txtEdadPacient = new javax.swing.JTextField();
        txtHora = new javax.swing.JLabel();
        jTextField8 = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        txtNumHC = new javax.swing.JTextField();
        jLabel26 = new javax.swing.JLabel();
        txtFecha = new javax.swing.JLabel();
        txtNomPacient = new javax.swing.JTextField();
        txtNumConsulta = new javax.swing.JTextField();
        jLabel30 = new javax.swing.JLabel();
        btnCerrarConsulta = new javax.swing.JButton();

        jLabel49.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N
        jLabel49.setForeground(new java.awt.Color(0, 12, 34));
        jLabel49.setText("EVOLUCIONES");

        tblEvoluciones.setBackground(new java.awt.Color(225, 228, 248));
        tblEvoluciones.setModel(modelotblEvoluciones);
        tblEvoluciones.setToolTipText("Doble Click para Visualizar Evolucion");
        tblEvoluciones.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblEvolucionesMouseClicked(evt);
            }
        });
        jScrollPane11.setViewportView(tblEvoluciones);

        jLabel48.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N
        jLabel48.setForeground(new java.awt.Color(0, 12, 34));
        jLabel48.setText("CONSULTAS");

        tblConsultas.setBackground(new java.awt.Color(209, 230, 239));
        tblConsultas.setModel(modelotblConsultas);
        tblConsultas.setToolTipText("Doble Click para Visualizar Consulta");
        tblConsultas.setComponentPopupMenu(jPopupMenu1);
        tblConsultas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblConsultasMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(tblConsultas);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 505, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 507, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(175, 175, 175)
                .addComponent(jLabel48)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel49)
                .addGap(190, 190, 190))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel48)
                    .addComponent(jLabel49))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 213, Short.MAX_VALUE)
                    .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        tblConsultasVisualizar.setBackground(new java.awt.Color(209, 230, 239));
        tblConsultasVisualizar.setModel(modelotblConsultasVisualizar);
        tblConsultasVisualizar.setToolTipText("Doble Click para Visualizar Consulta");
        tblConsultasVisualizar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblConsultasVisualizarMouseClicked(evt);
            }
        });
        jScrollPane13.setViewportView(tblConsultasVisualizar);

        jLabel50.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N
        jLabel50.setForeground(new java.awt.Color(0, 12, 34));
        jLabel50.setText("CONSULTAS (otros especialistas)");

        tblEvolucionesVisualizar.setBackground(new java.awt.Color(225, 228, 248));
        tblEvolucionesVisualizar.setModel(modelotblEvolucionesVisualizar);
        tblEvolucionesVisualizar.setToolTipText("Doble Click para Visualizar Evolucion");
        tblEvolucionesVisualizar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblEvolucionesVisualizarMouseClicked(evt);
            }
        });
        jScrollPane14.setViewportView(tblEvolucionesVisualizar);

        jLabel51.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N
        jLabel51.setForeground(new java.awt.Color(0, 12, 34));
        jLabel51.setText("Evoluciones (otros especialistas)");

        javax.swing.GroupLayout pnlConsultasLayout = new javax.swing.GroupLayout(pnlConsultas);
        pnlConsultas.setLayout(pnlConsultasLayout);
        pnlConsultasLayout.setHorizontalGroup(
            pnlConsultasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
            .addGroup(pnlConsultasLayout.createSequentialGroup()
                .addGroup(pnlConsultasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlConsultasLayout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addComponent(jLabel50)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(pnlConsultasLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane13)))
                .addGap(18, 18, 18)
                .addGroup(pnlConsultasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 505, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlConsultasLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel51)
                        .addGap(114, 114, 114)))
                .addGap(21, 21, 21))
            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, pnlConsultasLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnlConsultasLayout.setVerticalGroup(
            pnlConsultasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlConsultasLayout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlConsultasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel50, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel51, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlConsultasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jScrollPane13, javax.swing.GroupLayout.DEFAULT_SIZE, 108, Short.MAX_VALUE)
                    .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addContainerGap(44, Short.MAX_VALUE))
        );

        mnConsultaVisualizacion.setText("Habilitar Visualizacion para esṕecialistas");
        mnConsultaVisualizacion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnConsultaVisualizacionActionPerformed(evt);
            }
        });
        jPopupMenu1.add(mnConsultaVisualizacion);

        setClosable(true);
        setTitle("HISTORIA CLINICA");
        setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/PatientMale.png"))); // NOI18N
        setVisible(true);

        tpnlPaneles.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        pnlId.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Motivo de Consulta", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        cmbMotivoConsulta.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        btnAgregarMotivoConsulta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/add.png"))); // NOI18N
        btnAgregarMotivoConsulta.setToolTipText("Nuevo Motivo Consulta");
        btnAgregarMotivoConsulta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAgregarMotivoConsultaActionPerformed(evt);
            }
        });

        btnAddMotivoConsul.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/accept.png"))); // NOI18N
        btnAddMotivoConsul.setToolTipText(" APP");
        btnAddMotivoConsul.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAddMotivoConsulActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlIdLayout = new javax.swing.GroupLayout(pnlId);
        pnlId.setLayout(pnlIdLayout);
        pnlIdLayout.setHorizontalGroup(
            pnlIdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlIdLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlIdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlIdLayout.createSequentialGroup()
                        .addComponent(cmbMotivoConsulta, javax.swing.GroupLayout.PREFERRED_SIZE, 412, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(8, 8, 8)
                        .addComponent(btnAddMotivoConsul, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnAgregarMotivoConsulta, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 524, Short.MAX_VALUE))
                    .addComponent(txtMotivoConsulta))
                .addContainerGap())
        );
        pnlIdLayout.setVerticalGroup(
            pnlIdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlIdLayout.createSequentialGroup()
                .addGroup(pnlIdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlIdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(cmbMotivoConsulta)
                        .addComponent(btnAgregarMotivoConsulta, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 27, Short.MAX_VALUE))
                    .addComponent(btnAddMotivoConsul))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtMotivoConsulta))
        );

        pnlId1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Enfermedad Actual", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        txtEnfermedadActual.setColumns(20);
        txtEnfermedadActual.setLineWrap(true);
        txtEnfermedadActual.setRows(5);
        jScrollPane5.setViewportView(txtEnfermedadActual);

        javax.swing.GroupLayout pnlId1Layout = new javax.swing.GroupLayout(pnlId1);
        pnlId1.setLayout(pnlId1Layout);
        pnlId1Layout.setHorizontalGroup(
            pnlId1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlId1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane5)
                .addContainerGap())
        );
        pnlId1Layout.setVerticalGroup(
            pnlId1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)
        );

        pnlId2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Antecedentes", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        jPanel4.setMaximumSize(new java.awt.Dimension(500, 232));
        jPanel4.setMinimumSize(new java.awt.Dimension(500, 232));
        jPanel4.setPreferredSize(new java.awt.Dimension(500, 232));

        jLabel16.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel16.setText("Personales");

        txtAntecedentPerson.setColumns(20);
        txtAntecedentPerson.setLineWrap(true);
        txtAntecedentPerson.setRows(5);
        jScrollPane6.setViewportView(txtAntecedentPerson);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel16)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 476, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jLabel16)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane6)
                .addContainerGap())
        );

        jPanel5.setMinimumSize(new java.awt.Dimension(500, 232));
        jPanel5.setPreferredSize(new java.awt.Dimension(500, 232));

        jLabel23.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel23.setText("Familiares");

        txtAntecedentFami.setColumns(20);
        txtAntecedentFami.setLineWrap(true);
        txtAntecedentFami.setRows(5);
        jScrollPane7.setViewportView(txtAntecedentFami);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel23)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jScrollPane7))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jLabel23)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane7)
                .addContainerGap())
        );

        javax.swing.GroupLayout pnlId2Layout = new javax.swing.GroupLayout(pnlId2);
        pnlId2.setLayout(pnlId2Layout);
        pnlId2Layout.setHorizontalGroup(
            pnlId2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId2Layout.createSequentialGroup()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 75, Short.MAX_VALUE)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, 479, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        pnlId2Layout.setVerticalGroup(
            pnlId2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId2Layout.createSequentialGroup()
                .addGroup(pnlId2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 200, Short.MAX_VALUE)
                    .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout pnlAnamnesisLayout = new javax.swing.GroupLayout(pnlAnamnesis);
        pnlAnamnesis.setLayout(pnlAnamnesisLayout);
        pnlAnamnesisLayout.setHorizontalGroup(
            pnlAnamnesisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlAnamnesisLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlAnamnesisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(pnlId1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlId, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlId2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pnlAnamnesisLayout.setVerticalGroup(
            pnlAnamnesisLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlAnamnesisLayout.createSequentialGroup()
                .addComponent(pnlId, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlId1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlId2, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        tpnlPaneles.addTab("Anamnesis", pnlAnamnesis);

        pnlDiagReceta.setFont(new java.awt.Font("Ubuntu", 1, 13)); // NOI18N
        pnlDiagReceta.setPreferredSize(new java.awt.Dimension(1130, 484));
        pnlDiagReceta.setLayout(null);

        jLabel2.setFont(new java.awt.Font("Ubuntu", 1, 13)); // NOI18N
        jLabel2.setText("Anexos:");
        pnlDiagReceta.add(jLabel2);
        jLabel2.setBounds(12, 97, 51, 16);

        jLabel1.setFont(new java.awt.Font("Ubuntu", 1, 13)); // NOI18N
        jLabel1.setText("Diagnostico: ");

        jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        jScrollPane1.setMaximumSize(new java.awt.Dimension(850, 112));
        jScrollPane1.setMinimumSize(new java.awt.Dimension(850, 112));
        jScrollPane1.setPreferredSize(new java.awt.Dimension(850, 112));

        pnlDiagnosticos.setMaximumSize(new java.awt.Dimension(848, 100000));
        pnlDiagnosticos.setVerifyInputWhenFocusTarget(false);
        pnlDiagnosticos.setLayout(new javax.swing.BoxLayout(pnlDiagnosticos, javax.swing.BoxLayout.Y_AXIS));
        jScrollPane1.setViewportView(pnlDiagnosticos);

        btnAgregarDR.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/add.png"))); // NOI18N
        btnAgregarDR.setToolTipText("Agregar Dg");
        btnAgregarDR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAgregarDRActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addComponent(jLabel1)
                .addContainerGap(916, Short.MAX_VALUE))
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(btnAgregarDR)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 919, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addComponent(btnAgregarDR)
                .addContainerGap(31, Short.MAX_VALUE))
            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
        );

        pnlDiagReceta.add(jPanel12);
        jPanel12.setBounds(12, 0, 1000, 91);

        jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "RECETA MEDICA", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("DejaVu Sans", 1, 14), new java.awt.Color(148, 72, 36))); // NOI18N

        jLabel27.setFont(new java.awt.Font("Ubuntu", 1, 13)); // NOI18N
        jLabel27.setText("Medicamentos");

        txtIndicacionDR.setColumns(20);
        txtIndicacionDR.setLineWrap(true);
        txtIndicacionDR.setRows(5);
        jScrollPane8.setViewportView(txtIndicacionDR);

        txtMedicamentosDR.setColumns(20);
        txtMedicamentosDR.setLineWrap(true);
        txtMedicamentosDR.setRows(5);
        jScrollPane9.setViewportView(txtMedicamentosDR);

        jLabel28.setFont(new java.awt.Font("Ubuntu", 1, 13)); // NOI18N
        jLabel28.setText("Indicaciones");

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel27)
                    .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 386, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 71, Short.MAX_VALUE)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel28)
                    .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 389, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26))
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel28)
                    .addComponent(jLabel27))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE)
                    .addComponent(jScrollPane8)))
        );

        jLabel19.setFont(new java.awt.Font("Ubuntu", 1, 13)); // NOI18N
        jLabel19.setText("Medicamentos:");

        jLabel29.setFont(new java.awt.Font("Ubuntu", 1, 13)); // NOI18N
        jLabel29.setText("Patologia y Medicamentos:");

        jLabel3.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel3.setText("Cant:");

        btnAgregarPatologiaDR.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/Vial-Pills_2.png"))); // NOI18N
        btnAgregarPatologiaDR.setToolTipText("Agregar Enfermedad con Medicamentos e Indicaciones");
        btnAgregarPatologiaDR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAgregarPatologiaDRActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel15Layout.createSequentialGroup()
                        .addComponent(jLabel19)
                        .addGap(90, 90, 90)
                        .addComponent(cmbMedicamentoDR, javax.swing.GroupLayout.PREFERRED_SIZE, 291, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel3))
                    .addGroup(jPanel15Layout.createSequentialGroup()
                        .addComponent(jLabel29)
                        .addGap(18, 18, 18)
                        .addComponent(cmbPatologiaDR, javax.swing.GroupLayout.PREFERRED_SIZE, 291, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnAgregarPatologiaDR, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel15Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cmbMedicamentoDR, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3)))
                    .addGroup(jPanel15Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel19)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(cmbPatologiaDR, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel29))
                    .addComponent(btnAgregarPatologiaDR, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(12, 12, 12))
        );

        btnAgregarMedicamentoDR.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/Vial-O.png"))); // NOI18N
        btnAgregarMedicamentoDR.setToolTipText("Agregar Medicamento a la Receta");
        btnAgregarMedicamentoDR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAgregarMedicamentoDRActionPerformed(evt);
            }
        });

        txtCantidadMedicamentosDR.setBackground(new java.awt.Color(216, 187, 182));
        txtCantidadMedicamentosDR.setToolTipText("Ingrese la Cantidad de Medicamentos");
        txtCantidadMedicamentosDR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtCantidadMedicamentosDRActionPerformed(evt);
            }
        });
        txtCantidadMedicamentosDR.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtCantidadMedicamentosDRKeyTyped(evt);
            }
        });

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, 539, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtCantidadMedicamentosDR, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnAgregarMedicamentoDR)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnAgregarMedicamentoDR, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtCantidadMedicamentosDR, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(7, 7, 7)
                .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pnlDiagReceta.add(jPanel13);
        jPanel13.setBounds(12, 145, 896, 328);

        btnGuardarConsulta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/filesave.png"))); // NOI18N
        btnGuardarConsulta.setText("Guardar H.C.");
        btnGuardarConsulta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGuardarConsultaActionPerformed(evt);
            }
        });
        pnlDiagReceta.add(btnGuardarConsulta);
        btnGuardarConsulta.setBounds(920, 380, 150, 27);

        btnImprimirReceta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/printer1.png"))); // NOI18N
        btnImprimirReceta.setText("Imprimir Receta");
        btnImprimirReceta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnImprimirRecetaActionPerformed(evt);
            }
        });
        pnlDiagReceta.add(btnImprimirReceta);
        btnImprimirReceta.setBounds(920, 420, 150, 27);

        txtAnexoDR.setColumns(20);
        txtAnexoDR.setRows(5);
        jScrollPane10.setViewportView(txtAnexoDR);

        pnlDiagReceta.add(jScrollPane10);
        jScrollPane10.setBounds(90, 100, 920, 42);

        tpnlPaneles.addTab("Diagnostico/Receta", pnlDiagReceta);

        pnlEvolucion.setPreferredSize(new java.awt.Dimension(1130, 484));

        btnGuardarEvolucion.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/filesave.png"))); // NOI18N
        btnGuardarEvolucion.setText("Guardar Evolucion");
        btnGuardarEvolucion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGuardarEvolucionActionPerformed(evt);
            }
        });

        btnImprimirEvolucion.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/printer1.png"))); // NOI18N
        btnImprimirEvolucion.setText("Imprimir Receta");

        jLabel12.setText("Fecha");

        jLabel13.setText("Hora");

        jLabel22.setFont(new java.awt.Font("DejaVu Sans", 1, 18)); // NOI18N
        jLabel22.setForeground(new java.awt.Color(0, 3, 83));
        jLabel22.setText("Evolucion");

        txtEvolucion.setColumns(20);
        txtEvolucion.setRows(5);
        jScrollPane12.setViewportView(txtEvolucion);

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addComponent(jLabel12)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtFechaEvolucion, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel13)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtHoraEvolucion, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(465, Short.MAX_VALUE))
            .addComponent(jScrollPane12)
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel22)
                    .addComponent(jLabel13)
                    .addComponent(txtHoraEvolucion, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel12)
                        .addComponent(txtFechaEvolucion, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 104, Short.MAX_VALUE))
        );

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "RECETA MEDICA", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("DejaVu Sans", 1, 14), new java.awt.Color(148, 72, 36))); // NOI18N

        jLabel20.setFont(new java.awt.Font("Ubuntu", 1, 13)); // NOI18N
        jLabel20.setText("Medicamentos");

        txtIndicacionesE.setColumns(20);
        txtIndicacionesE.setRows(5);
        jScrollPane4.setViewportView(txtIndicacionesE);

        txtMedicamentosE.setColumns(20);
        txtMedicamentosE.setRows(5);
        jScrollPane3.setViewportView(txtMedicamentosE);

        jLabel21.setFont(new java.awt.Font("Ubuntu", 1, 13)); // NOI18N
        jLabel21.setText("Indicaciones");

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel20)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 417, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 40, Short.MAX_VALUE)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel21)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 415, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel21)
                    .addComponent(jLabel20))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE)
                    .addComponent(jScrollPane4)))
        );

        btnAgregarPatologiaE.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/Vial-Pills_2.png"))); // NOI18N
        btnAgregarPatologiaE.setToolTipText("Agregar Enfermedad con Medicamentos e Indicaciones");
        btnAgregarPatologiaE.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAgregarPatologiaEActionPerformed(evt);
            }
        });

        jLabel17.setFont(new java.awt.Font("Ubuntu", 1, 13)); // NOI18N
        jLabel17.setText("Medicamentos:");

        jLabel18.setFont(new java.awt.Font("Ubuntu", 1, 13)); // NOI18N
        jLabel18.setText("Patologia y Medicamentos:");

        jLabel4.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel4.setText("Cant:");

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel17)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(190, 190, 190)
                        .addComponent(cmbMedicamentoE, javax.swing.GroupLayout.PREFERRED_SIZE, 291, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addComponent(jLabel4))
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addComponent(jLabel18)
                .addGap(18, 18, 18)
                .addComponent(cmbPatologiaE, javax.swing.GroupLayout.PREFERRED_SIZE, 291, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addComponent(btnAgregarPatologiaE))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGap(4, 4, 4)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel17)
                    .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(cmbMedicamentoE, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel4)))
                .addGap(11, 11, 11)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(cmbPatologiaE, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel18))
                        .addGap(5, 5, 5))
                    .addComponent(btnAgregarPatologiaE, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        btnAgregarMedicamentoE.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/Vial-O.png"))); // NOI18N
        btnAgregarMedicamentoE.setToolTipText("Agregar Medicamento a la Receta");
        btnAgregarMedicamentoE.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAgregarMedicamentoEActionPerformed(evt);
            }
        });

        txtCantidadMedicamentosE.setBackground(new java.awt.Color(216, 187, 182));
        txtCantidadMedicamentosE.setToolTipText("Ingrese la Cantidad de Medicamentos");
        txtCantidadMedicamentosE.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtCantidadMedicamentosEActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, 535, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtCantidadMedicamentosE, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnAgregarMedicamentoE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnAgregarMedicamentoE, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtCantidadMedicamentosE, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout pnlEvolucionLayout = new javax.swing.GroupLayout(pnlEvolucion);
        pnlEvolucion.setLayout(pnlEvolucionLayout);
        pnlEvolucionLayout.setHorizontalGroup(
            pnlEvolucionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlEvolucionLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlEvolucionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlEvolucionLayout.createSequentialGroup()
                        .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlEvolucionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnGuardarEvolucion, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
                            .addComponent(btnImprimirEvolucion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addContainerGap())
                    .addGroup(pnlEvolucionLayout.createSequentialGroup()
                        .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(9, 9, 9))))
        );
        pnlEvolucionLayout.setVerticalGroup(
            pnlEvolucionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlEvolucionLayout.createSequentialGroup()
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlEvolucionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlEvolucionLayout.createSequentialGroup()
                        .addComponent(btnGuardarEvolucion)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnImprimirEvolucion)
                        .addGap(43, 43, 43))))
        );

        tpnlPaneles.addTab("Evolucion", pnlEvolucion);

        pnlId3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Signos Vitales:", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        jLabel7.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel7.setText("T.A:");

        jLabel24.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel24.setText("mm. hg");

        jLabel25.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel25.setText("FC:");

        jLabel31.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel31.setText("lpm");

        jLabel32.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel32.setText("FR:");

        jLabel33.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel33.setText("rpm");

        jLabel34.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel34.setText("Tº");

        txtFc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtFcActionPerformed(evt);
            }
        });
        txtFc.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtFcKeyTyped(evt);
            }
        });

        txtFr.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtFrKeyTyped(evt);
            }
        });

        txtTemperatura.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtTemperaturaKeyTyped(evt);
            }
        });

        cmbTemperatura.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Bucal", "Axilar", "Rectal" }));

        jLabel5.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel5.setText("GLICEMIA:");

        jLabel6.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel6.setText("mg/dl");

        jLabel35.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel35.setText("SAT02:");

        txtSat02.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtSat02KeyTyped(evt);
            }
        });

        jLabel36.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel36.setText("%");

        jLabel37.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel37.setText("Llenado Capilar:");

        javax.swing.GroupLayout pnlId3Layout = new javax.swing.GroupLayout(pnlId3);
        pnlId3.setLayout(pnlId3Layout);
        pnlId3Layout.setHorizontalGroup(
            pnlId3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId3Layout.createSequentialGroup()
                .addGap(56, 56, 56)
                .addGroup(pnlId3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlId3Layout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addGap(11, 11, 11)
                        .addComponent(txtTa, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel24)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel25))
                    .addGroup(pnlId3Layout.createSequentialGroup()
                        .addComponent(jLabel35)
                        .addGap(1, 1, 1)
                        .addComponent(txtSat02, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel36)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 44, Short.MAX_VALUE)
                        .addComponent(jLabel37)))
                .addGap(18, 18, 18)
                .addGroup(pnlId3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(pnlId3Layout.createSequentialGroup()
                        .addComponent(txtFc, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel31)
                        .addGap(110, 110, 110)
                        .addComponent(jLabel32))
                    .addGroup(pnlId3Layout.createSequentialGroup()
                        .addComponent(txtLlenadoCapilar, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel5)))
                .addGap(4, 4, 4)
                .addGroup(pnlId3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlId3Layout.createSequentialGroup()
                        .addComponent(txtFr, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel33)
                        .addGap(63, 63, 63)
                        .addComponent(jLabel34)
                        .addGap(11, 11, 11)
                        .addComponent(txtTemperatura, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cmbTemperatura, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnlId3Layout.createSequentialGroup()
                        .addComponent(txtGlicemia, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(3, 3, 3)
                        .addComponent(jLabel6)))
                .addGap(63, 63, 63))
        );
        pnlId3Layout.setVerticalGroup(
            pnlId3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId3Layout.createSequentialGroup()
                .addGroup(pnlId3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtFr)
                    .addGroup(pnlId3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel7)
                        .addComponent(jLabel24)
                        .addComponent(txtTa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel25)
                        .addComponent(txtFc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel31)
                        .addComponent(jLabel32)
                        .addComponent(jLabel33)
                        .addComponent(jLabel34)
                        .addComponent(txtTemperatura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(cmbTemperatura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlId3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlId3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel35)
                        .addComponent(txtSat02, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel36)
                        .addComponent(jLabel37)
                        .addComponent(txtLlenadoCapilar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnlId3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel5)
                        .addComponent(txtGlicemia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel6)))
                .addContainerGap())
        );

        pnlId4.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Peso y Talla:", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        jLabel38.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel38.setText("Peso");

        jLabel39.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel39.setText("Kg");

        jLabel40.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel40.setText("Talla");

        jLabel41.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel41.setText("cm");

        jLabel42.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel42.setText("IMC:");

        txtPeso.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtPesoKeyTyped(evt);
            }
        });

        txtTalla.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtTallaActionPerformed(evt);
            }
        });
        txtTalla.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txtTallaFocusLost(evt);
            }
        });
        txtTalla.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtTallaKeyTyped(evt);
            }
        });

        txtImc.setBackground(new java.awt.Color(225, 228, 248));
        txtImc.setEditable(false);
        txtImc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtImcActionPerformed(evt);
            }
        });
        txtImc.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                txtImcFocusGained(evt);
            }
        });

        javax.swing.GroupLayout pnlId4Layout = new javax.swing.GroupLayout(pnlId4);
        pnlId4.setLayout(pnlId4Layout);
        pnlId4Layout.setHorizontalGroup(
            pnlId4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId4Layout.createSequentialGroup()
                .addGap(182, 182, 182)
                .addComponent(jLabel38)
                .addGap(11, 11, 11)
                .addComponent(txtPeso, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(28, 28, 28)
                .addComponent(jLabel39)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 115, Short.MAX_VALUE)
                .addComponent(jLabel40)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtTalla, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel41)
                .addGap(110, 110, 110)
                .addComponent(jLabel42)
                .addGap(4, 4, 4)
                .addComponent(txtImc, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(230, 230, 230))
        );
        pnlId4Layout.setVerticalGroup(
            pnlId4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlId4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtImc)
                    .addGroup(pnlId4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel38)
                        .addComponent(jLabel39)
                        .addComponent(txtPeso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel40)
                        .addComponent(txtTalla, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel41)
                        .addComponent(jLabel42)))
                .addGap(39, 39, 39))
        );

        pnlId5.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        jLabel43.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel43.setText("Biotipo Constitucional:");

        jLabel45.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel45.setText("Estado Nutricional");

        jLabel47.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel47.setText("Fascies:");

        cmbBiotipoConst.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Astenico", "Normosomico", "Picnico", "Atletico" }));

        cmbEstadoNutri.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Bueno", "Regular", "Malo" }));

        jLabel44.setText("Psicoexpresiva");

        jLabel46.setText("Somatoexpresiva");

        txtPsicoexpresiva.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtPsicoexpresivaKeyTyped(evt);
            }
        });

        txtSomatoexpresiva.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txtSomatoexpresivaKeyTyped(evt);
            }
        });

        javax.swing.GroupLayout pnlId5Layout = new javax.swing.GroupLayout(pnlId5);
        pnlId5.setLayout(pnlId5Layout);
        pnlId5Layout.setHorizontalGroup(
            pnlId5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId5Layout.createSequentialGroup()
                .addGap(50, 50, 50)
                .addComponent(jLabel43)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cmbBiotipoConst, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 48, Short.MAX_VALUE)
                .addComponent(jLabel47)
                .addGap(18, 18, 18)
                .addGroup(pnlId5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlId5Layout.createSequentialGroup()
                        .addComponent(jLabel46)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                    .addGroup(pnlId5Layout.createSequentialGroup()
                        .addComponent(jLabel44)
                        .addGap(30, 30, 30)))
                .addGroup(pnlId5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtSomatoexpresiva)
                    .addComponent(txtPsicoexpresiva, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel45)
                .addGap(4, 4, 4)
                .addComponent(cmbEstadoNutri, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(64, 64, 64))
        );
        pnlId5Layout.setVerticalGroup(
            pnlId5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlId5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel45)
                    .addComponent(cmbEstadoNutri, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel43)
                    .addComponent(cmbBiotipoConst, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
            .addGroup(pnlId5Layout.createSequentialGroup()
                .addGroup(pnlId5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlId5Layout.createSequentialGroup()
                        .addGroup(pnlId5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel44)
                            .addComponent(txtPsicoexpresiva, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(8, 8, 8)
                        .addGroup(pnlId5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel46)
                            .addComponent(txtSomatoexpresiva, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(pnlId5Layout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addComponent(jLabel47)))
                .addGap(0, 45, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout pnlExamenFisicoLayout = new javax.swing.GroupLayout(pnlExamenFisico);
        pnlExamenFisico.setLayout(pnlExamenFisicoLayout);
        pnlExamenFisicoLayout.setHorizontalGroup(
            pnlExamenFisicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlExamenFisicoLayout.createSequentialGroup()
                .addGroup(pnlExamenFisicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnlId3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pnlId4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pnlId5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(0, 37, Short.MAX_VALUE))
        );
        pnlExamenFisicoLayout.setVerticalGroup(
            pnlExamenFisicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlExamenFisicoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlId3, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlId4, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(pnlId5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(148, Short.MAX_VALUE))
        );

        tpnlPaneles.addTab("Examen Fisico", pnlExamenFisico);

        pnlId6.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Cabeza", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        txtEnfermedadActual1.setColumns(20);
        txtEnfermedadActual1.setLineWrap(true);
        txtEnfermedadActual1.setRows(5);
        jScrollPane15.setViewportView(txtEnfermedadActual1);

        javax.swing.GroupLayout pnlId6Layout = new javax.swing.GroupLayout(pnlId6);
        pnlId6.setLayout(pnlId6Layout);
        pnlId6Layout.setHorizontalGroup(
            pnlId6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlId6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane15, javax.swing.GroupLayout.DEFAULT_SIZE, 1030, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnlId6Layout.setVerticalGroup(
            pnlId6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId6Layout.createSequentialGroup()
                .addComponent(jScrollPane15, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 4, Short.MAX_VALUE))
        );

        pnlId7.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Ojos", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        txtEnfermedadActual2.setColumns(20);
        txtEnfermedadActual2.setLineWrap(true);
        txtEnfermedadActual2.setRows(5);
        jScrollPane16.setViewportView(txtEnfermedadActual2);

        javax.swing.GroupLayout pnlId7Layout = new javax.swing.GroupLayout(pnlId7);
        pnlId7.setLayout(pnlId7Layout);
        pnlId7Layout.setHorizontalGroup(
            pnlId7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlId7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane16, javax.swing.GroupLayout.DEFAULT_SIZE, 1030, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnlId7Layout.setVerticalGroup(
            pnlId7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId7Layout.createSequentialGroup()
                .addComponent(jScrollPane16, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 15, Short.MAX_VALUE))
        );

        pnlId8.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Oidos", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        txtEnfermedadActual3.setColumns(20);
        txtEnfermedadActual3.setLineWrap(true);
        txtEnfermedadActual3.setRows(5);
        jScrollPane17.setViewportView(txtEnfermedadActual3);

        javax.swing.GroupLayout pnlId8Layout = new javax.swing.GroupLayout(pnlId8);
        pnlId8.setLayout(pnlId8Layout);
        pnlId8Layout.setHorizontalGroup(
            pnlId8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlId8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane17, javax.swing.GroupLayout.DEFAULT_SIZE, 1030, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnlId8Layout.setVerticalGroup(
            pnlId8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId8Layout.createSequentialGroup()
                .addComponent(jScrollPane17, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 7, Short.MAX_VALUE))
        );

        pnlId9.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Nariz", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        txtEnfermedadActual4.setColumns(20);
        txtEnfermedadActual4.setLineWrap(true);
        txtEnfermedadActual4.setRows(5);
        jScrollPane18.setViewportView(txtEnfermedadActual4);

        javax.swing.GroupLayout pnlId9Layout = new javax.swing.GroupLayout(pnlId9);
        pnlId9.setLayout(pnlId9Layout);
        pnlId9Layout.setHorizontalGroup(
            pnlId9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlId9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane18, javax.swing.GroupLayout.DEFAULT_SIZE, 1030, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnlId9Layout.setVerticalGroup(
            pnlId9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId9Layout.createSequentialGroup()
                .addComponent(jScrollPane18, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 8, Short.MAX_VALUE))
        );

        pnlId10.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Boca", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        txtEnfermedadActual5.setColumns(20);
        txtEnfermedadActual5.setLineWrap(true);
        txtEnfermedadActual5.setRows(5);
        jScrollPane19.setViewportView(txtEnfermedadActual5);

        javax.swing.GroupLayout pnlId10Layout = new javax.swing.GroupLayout(pnlId10);
        pnlId10.setLayout(pnlId10Layout);
        pnlId10Layout.setHorizontalGroup(
            pnlId10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlId10Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane19, javax.swing.GroupLayout.DEFAULT_SIZE, 1030, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnlId10Layout.setVerticalGroup(
            pnlId10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId10Layout.createSequentialGroup()
                .addComponent(jScrollPane19, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 9, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnlId6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlId7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlId8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlId9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlId10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlId6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlId8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(pnlId7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlId9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(pnlId10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(33, 33, 33))
        );

        tpnlPaneles.addTab("Examen Fisico Regional 1", jPanel2);

        pnlId11.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Cuello", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        txtEnfermedadActual6.setColumns(20);
        txtEnfermedadActual6.setLineWrap(true);
        txtEnfermedadActual6.setRows(5);
        jScrollPane20.setViewportView(txtEnfermedadActual6);

        javax.swing.GroupLayout pnlId11Layout = new javax.swing.GroupLayout(pnlId11);
        pnlId11.setLayout(pnlId11Layout);
        pnlId11Layout.setHorizontalGroup(
            pnlId11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlId11Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane20, javax.swing.GroupLayout.DEFAULT_SIZE, 1030, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnlId11Layout.setVerticalGroup(
            pnlId11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId11Layout.createSequentialGroup()
                .addComponent(jScrollPane20, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 6, Short.MAX_VALUE))
        );

        pnlId12.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Torax", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        txtEnfermedadActual7.setColumns(20);
        txtEnfermedadActual7.setLineWrap(true);
        txtEnfermedadActual7.setRows(5);
        jScrollPane21.setViewportView(txtEnfermedadActual7);

        jLabel52.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel52.setText("Corazon");

        jLabel53.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel53.setText("Pulmones");

        txtEnfermedadActual11.setColumns(20);
        txtEnfermedadActual11.setLineWrap(true);
        txtEnfermedadActual11.setRows(5);
        jScrollPane25.setViewportView(txtEnfermedadActual11);

        txtEnfermedadActual12.setColumns(20);
        txtEnfermedadActual12.setLineWrap(true);
        txtEnfermedadActual12.setRows(5);
        jScrollPane26.setViewportView(txtEnfermedadActual12);

        javax.swing.GroupLayout pnlId12Layout = new javax.swing.GroupLayout(pnlId12);
        pnlId12.setLayout(pnlId12Layout);
        pnlId12Layout.setHorizontalGroup(
            pnlId12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId12Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlId12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane21, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1030, Short.MAX_VALUE)
                    .addGroup(pnlId12Layout.createSequentialGroup()
                        .addComponent(jLabel52)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane26, javax.swing.GroupLayout.PREFERRED_SIZE, 396, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel53)
                        .addGap(32, 32, 32)
                        .addComponent(jScrollPane25, javax.swing.GroupLayout.PREFERRED_SIZE, 396, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        pnlId12Layout.setVerticalGroup(
            pnlId12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId12Layout.createSequentialGroup()
                .addComponent(jScrollPane21, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlId12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane25, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane26, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(pnlId12Layout.createSequentialGroup()
                        .addGap(9, 9, 9)
                        .addComponent(jLabel52))
                    .addGroup(pnlId12Layout.createSequentialGroup()
                        .addGap(8, 8, 8)
                        .addComponent(jLabel53))))
        );

        pnlId13.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Abdomen", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        txtEnfermedadActual8.setColumns(20);
        txtEnfermedadActual8.setLineWrap(true);
        txtEnfermedadActual8.setRows(5);
        jScrollPane22.setViewportView(txtEnfermedadActual8);

        javax.swing.GroupLayout pnlId13Layout = new javax.swing.GroupLayout(pnlId13);
        pnlId13.setLayout(pnlId13Layout);
        pnlId13Layout.setHorizontalGroup(
            pnlId13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlId13Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane22, javax.swing.GroupLayout.DEFAULT_SIZE, 1030, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnlId13Layout.setVerticalGroup(
            pnlId13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane22, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pnlId14.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Region Lumbar", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        txtEnfermedadActual9.setColumns(20);
        txtEnfermedadActual9.setLineWrap(true);
        txtEnfermedadActual9.setRows(5);
        jScrollPane23.setViewportView(txtEnfermedadActual9);

        javax.swing.GroupLayout pnlId14Layout = new javax.swing.GroupLayout(pnlId14);
        pnlId14.setLayout(pnlId14Layout);
        pnlId14Layout.setHorizontalGroup(
            pnlId14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlId14Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane23, javax.swing.GroupLayout.DEFAULT_SIZE, 1030, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnlId14Layout.setVerticalGroup(
            pnlId14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane23, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pnlId15.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Region Genito-Urinario", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        txtEnfermedadActual10.setColumns(20);
        txtEnfermedadActual10.setLineWrap(true);
        txtEnfermedadActual10.setRows(5);
        jScrollPane24.setViewportView(txtEnfermedadActual10);

        javax.swing.GroupLayout pnlId15Layout = new javax.swing.GroupLayout(pnlId15);
        pnlId15.setLayout(pnlId15Layout);
        pnlId15Layout.setHorizontalGroup(
            pnlId15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlId15Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane24, javax.swing.GroupLayout.DEFAULT_SIZE, 1030, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnlId15Layout.setVerticalGroup(
            pnlId15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane24, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)
        );

        pnlId17.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED), "Extremidades", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, null, null));

        txtEnfermedadActual14.setColumns(20);
        txtEnfermedadActual14.setLineWrap(true);
        txtEnfermedadActual14.setRows(5);
        jScrollPane28.setViewportView(txtEnfermedadActual14);

        javax.swing.GroupLayout pnlId17Layout = new javax.swing.GroupLayout(pnlId17);
        pnlId17.setLayout(pnlId17Layout);
        pnlId17Layout.setHorizontalGroup(
            pnlId17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlId17Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane28, javax.swing.GroupLayout.DEFAULT_SIZE, 1030, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnlId17Layout.setVerticalGroup(
            pnlId17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane28, javax.swing.GroupLayout.DEFAULT_SIZE, 31, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnlId11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlId13, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlId12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlId14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlId15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlId17, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlId11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(3, 3, 3)
                .addComponent(pnlId12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlId13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlId14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlId15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlId17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        tpnlPaneles.addTab("Examen Fisico Regional 2", jPanel3);

        btnNewEvolucion.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/Edit.png"))); // NOI18N
        btnNewEvolucion.setText("Evolucion");
        btnNewEvolucion.setToolTipText("Crear Evolucion del Paciente");
        btnNewEvolucion.setEnabled(false);
        btnNewEvolucion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNewEvolucionActionPerformed(evt);
            }
        });

        btnImprimirHC.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/PatientData.png"))); // NOI18N
        btnImprimirHC.setText("Imprimir H.C");
        btnImprimirHC.setToolTipText("Imprimir la Historia Clinica o Evolucion");
        btnImprimirHC.setEnabled(false);
        btnImprimirHC.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnImprimirHCActionPerformed(evt);
            }
        });

        btnNewConsulta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/add.png"))); // NOI18N
        btnNewConsulta.setText("Nuevo");
        btnNewConsulta.setToolTipText("Crear Consulta");
        btnNewConsulta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNewConsultaActionPerformed(evt);
            }
        });

        jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/agt_home.png"))); // NOI18N
        jButton6.setText("Cerrar");
        jButton6.setToolTipText("Salir");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        btnViewDatosPersonales.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/PatientMale.png"))); // NOI18N
        btnViewDatosPersonales.setText("Datos Personales");
        btnViewDatosPersonales.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnViewDatosPersonalesActionPerformed(evt);
            }
        });

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/Certificado Medico.png"))); // NOI18N
        jButton1.setText("Certificado Medico");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        btnExamenes.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/dep1.png"))); // NOI18N
        btnExamenes.setText("Examenes");
        btnExamenes.setToolTipText("");
        btnExamenes.setEnabled(false);
        btnExamenes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnExamenesActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlBotonesLayout = new javax.swing.GroupLayout(pnlBotones);
        pnlBotones.setLayout(pnlBotonesLayout);
        pnlBotonesLayout.setHorizontalGroup(
            pnlBotonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBotonesLayout.createSequentialGroup()
                .addComponent(btnNewConsulta, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(btnNewEvolucion, javax.swing.GroupLayout.DEFAULT_SIZE, 121, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnExamenes, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnImprimirHC, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnViewDatosPersonales)
                .addGap(35, 35, 35)
                .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        pnlBotonesLayout.setVerticalGroup(
            pnlBotonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlBotonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(btnViewDatosPersonales, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btnImprimirHC, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btnExamenes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addComponent(btnNewEvolucion)
            .addComponent(btnNewConsulta, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        jLabel11.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel11.setText("Consulta:");

        jLabel10.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel10.setText("Proxima Cita:");

        txtEdadPacient.setBackground(new java.awt.Color(225, 228, 248));
        txtEdadPacient.setEditable(false);

        jTextField8.setBackground(new java.awt.Color(115, 172, 68));
        jTextField8.setToolTipText("Doble click para seleccionar la proxima cita");
        jTextField8.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTextField8MouseClicked(evt);
            }
        });
        jTextField8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField8ActionPerformed(evt);
            }
        });

        jLabel15.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel15.setText("Hora:");

        jLabel9.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel9.setText("Nro Hc:");

        jLabel8.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel8.setText("Edad:");

        jLabel14.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel14.setText("Fecha:");

        txtNumHC.setBackground(new java.awt.Color(250, 249, 203));
        txtNumHC.setEditable(false);

        jLabel26.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
        jLabel26.setText("Paciente:");

        txtNomPacient.setBackground(new java.awt.Color(225, 228, 248));
        txtNomPacient.setEditable(false);
        txtNomPacient.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtNomPacientActionPerformed(evt);
            }
        });

        txtNumConsulta.setBackground(new java.awt.Color(250, 249, 203));
        txtNumConsulta.setEditable(false);

        jLabel30.setText("años");

        btnCerrarConsulta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jpgs/delete.png"))); // NOI18N
        btnCerrarConsulta.setToolTipText("Cerrar");
        btnCerrarConsulta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCerrarConsultaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlEmcabezadoLayout = new javax.swing.GroupLayout(pnlEmcabezado);
        pnlEmcabezado.setLayout(pnlEmcabezadoLayout);
        pnlEmcabezadoLayout.setHorizontalGroup(
            pnlEmcabezadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlEmcabezadoLayout.createSequentialGroup()
                .addGroup(pnlEmcabezadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlEmcabezadoLayout.createSequentialGroup()
                        .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(22, 22, 22))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlEmcabezadoLayout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addGroup(pnlEmcabezadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtNumConsulta)
                    .addComponent(txtNumHC, javax.swing.GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE))
                .addGroup(pnlEmcabezadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlEmcabezadoLayout.createSequentialGroup()
                        .addGap(2, 2, 2)
                        .addComponent(jLabel26)
                        .addGap(4, 4, 4)
                        .addComponent(txtNomPacient, javax.swing.GroupLayout.PREFERRED_SIZE, 377, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnlEmcabezadoLayout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtEdadPacient, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel30)))
                .addGap(18, 18, 18)
                .addGroup(pnlEmcabezadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlEmcabezadoLayout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 232, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(pnlEmcabezadoLayout.createSequentialGroup()
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtHora, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 60, Short.MAX_VALUE)
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnCerrarConsulta, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );
        pnlEmcabezadoLayout.setVerticalGroup(
            pnlEmcabezadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlEmcabezadoLayout.createSequentialGroup()
                .addGroup(pnlEmcabezadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(pnlEmcabezadoLayout.createSequentialGroup()
                        .addGap(40, 40, 40)
                        .addComponent(btnCerrarConsulta, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(pnlEmcabezadoLayout.createSequentialGroup()
                        .addGroup(pnlEmcabezadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(pnlEmcabezadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(txtNumHC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel26)
                                .addComponent(txtNomPacient, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(pnlEmcabezadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jLabel14, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(txtFecha, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(pnlEmcabezadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(txtEdadPacient)
                            .addComponent(jTextField8)
                            .addComponent(jLabel10)
                            .addComponent(txtHora, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel30, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(txtNumConsulta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(pnlEmcabezado, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(tpnlPaneles, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 1098, Short.MAX_VALUE))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(pnlBotones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(pnlEmcabezado, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tpnlPaneles, javax.swing.GroupLayout.PREFERRED_SIZE, 510, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlBotones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnAgregarMotivoConsultaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarMotivoConsultaActionPerformed
        iFrmHCMotivo form = new iFrmHCMotivo();
        frmPrincipal.dskpPrincipal.add(form);
        OperacionesVarias.centrar(form);
        form.setVisible(true);
    }//GEN-LAST:event_btnAgregarMotivoConsultaActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        int aux = JOptionPane.showConfirmDialog(this, "¿Realmente desea cerrar la consulta?\n "
                + "Cualquier dato que no haya sido guardado se perdera\n"
                + "¿Esta seguro de querer continuar?", "Importante", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
        if (aux == 0) {
            dispose();
        }
    }//GEN-LAST:event_jButton6ActionPerformed

    private void txtNomPacientActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNomPacientActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtNomPacientActionPerformed

    private void btnNewConsultaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNewConsultaActionPerformed
        agregarPaneles();
        newConsulta();
        btnNewConsulta.setEnabled(false);
        btnExamenes.setEnabled(false);
        btnImprimirHC.setEnabled(false);
    }//GEN-LAST:event_btnNewConsultaActionPerformed

    private void jTextField8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField8ActionPerformed
    }//GEN-LAST:event_jTextField8ActionPerformed

    private void jTextField8MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField8MouseClicked
        iFrmReservaCita form = new iFrmReservaCita(paciente);
        frmPrincipal.dskpPrincipal.add(form);
        OperacionesVarias.centrar(form);
        form.toFront();
        form.setVisible(true);
    }//GEN-LAST:event_jTextField8MouseClicked

    private void btnAddMotivoConsulActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddMotivoConsulActionPerformed
        int index = cmbMotivoConsulta.getSelectedIndex();
        if (index != -1) {
            Motivo_Consulta aux = (Motivo_Consulta) listMotivoConsultas.get(index);
            if (consulta.getMotivo_Consulta().contains(aux)) {
                consulta.getMotivo_Consulta().remove(aux);
            } else {
                consulta.getMotivo_Consulta().add(aux);
            }
            txtMotivoConsulta.setText("");
            for (int i = 0; i < consulta.getMotivo_Consulta().size(); i++) {
                txtMotivoConsulta.setText(txtMotivoConsulta.getText() + (i + 1) + ".- " + consulta.getMotivo_Consulta().get(i) + "    ");
            }
        }
    }//GEN-LAST:event_btnAddMotivoConsulActionPerformed

    private void btnAgregarDRActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarDRActionPerformed
        pnlsDiagnosticos.add(new pnlDiagnostico());
        pnlDiagnosticos.add(pnlsDiagnosticos.get(pnlsDiagnosticos.size() - 1));
    }//GEN-LAST:event_btnAgregarDRActionPerformed

    private void tblConsultasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblConsultasMouseClicked
        if (tblConsultas.getRowCount() > 0) {
            int aux = tblConsultas.getSelectedRow();
            if (aux != -1) {
                consulta = (Consulta) listConsultas.get(aux);
                btnExamenes.setEnabled(true);
                if (evt.getClickCount() == 2) {

                    setConsulta(consulta);
                    setEditable(true);
                    agregarPaneles();
                    btnNewEvolucion.setEnabled(true);
                    btnCerrarConsulta.setVisible(true);
                    btnImprimirHC.setEnabled(true);

                } else if (evt.getClickCount() == 1) {
                    cargarEvoluciones();
                    tblConsultasVisualizar.clearSelection();
                    tblEvolucionesVisualizar.clearSelection();
                }

            } else {
                JOptionPane.showMessageDialog(this, "Seleccione la consulta ...", "Visualizar Consulta", JOptionPane.WARNING_MESSAGE);
            }
        } else {
            JOptionPane.showMessageDialog(this, "No ha registrado ninguna consulta ...", "Visualizar Consulta", JOptionPane.WARNING_MESSAGE);
        }



    }//GEN-LAST:event_tblConsultasMouseClicked

    private void pnlDiagnostico1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pnlDiagnostico1MouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_pnlDiagnostico1MouseClicked

    private void btnCerrarConsultaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCerrarConsultaActionPerformed
        int aux = IFrmHCGeneral.NULO;
        switch (getEstadoForm()) {
            case IFrmHCGeneral.NEW_CONSULTA:
                aux = JOptionPane.showConfirmDialog(this, "Los Datos de la consulta no han sido guardados:\n "
                        + "Si continua la informacion se perdera"
                        + "¿Esta seguro de querer continuar?", "Cerrar Consulta", JOptionPane.YES_NO_OPTION);
                break;
            case IFrmHCGeneral.VIEW_CONSULTA:
                aux = 0;
                break;
            case IFrmHCGeneral.NEW_EVOLUCION:
                aux = JOptionPane.showConfirmDialog(this, "Los Datos de la evolucion no han sido guardados:\n "
                        + "Si continua la informacion se perdera"
                        + "¿Esta seguro de querer continuar?", "Cerrar Evolucion", JOptionPane.YES_NO_OPTION);
                break;
            case IFrmHCGeneral.VIEW_EVOLUCION:
                aux = 0;
                break;
        }

        if (aux == 0) {
            tpnlPaneles.removeAll();
            listConsultas = (ArrayList<Object>) ConsultaBD.listarConsultas(paciente, usuario);
            if (!listConsultas.isEmpty()) {
                cargarConsultas();
                cargarEvoluciones();
                tpnlPaneles.add(pnlConsultas);
                tpnlPaneles.setTitleAt(0, "Listado de Consultas");
                btnExamenes.setEnabled(false);
                btnImprimirHC.setEnabled(false);
            }
            GregorianCalendar c = new GregorianCalendar();
            String dia = Calendario.diasCalendario[c.get(GregorianCalendar.DAY_OF_WEEK) - 1];
            txtFecha.setText(dia + ", " + OperacionesVarias.fechaString(c.getTime()));
            txtHora.setText(c.get(GregorianCalendar.HOUR) + ":" + c.get(GregorianCalendar.MINUTE) + ":" + c.get(GregorianCalendar.SECOND));
            txtNumConsulta.setText("");
            btnCerrarConsulta.setVisible(false);
            btnNewEvolucion.setEnabled(false);
            btnNewConsulta.setEnabled(true);
        }
    }//GEN-LAST:event_btnCerrarConsultaActionPerformed

    private void btnGuardarConsultaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGuardarConsultaActionPerformed
        int aux = JOptionPane.showConfirmDialog(this, "Los datos que se guardaran a continuacion no podran ser modificados:\n "
                + "¿Esta seguro de querer continuar?", "Guardar Consulta", JOptionPane.YES_NO_OPTION);
        if (aux == 0) {

            switch (getEstadoForm()) {

                case IFrmHCGeneral.NEW_CONSULTA:

                    if (OperacionesBD.guardar(getConsulta(consulta))) {
                        setEstadoForm(IFrmHCGeneral.VIEW_CONSULTA);
                        btnNewEvolucion.setEnabled(true);
                        btnExamenes.setEnabled(true);
                        btnImprimirHC.setEnabled(true);
                        JOptionPane.showMessageDialog(null, "Datos de consulta guardados correctamente ...", "Guardar", JOptionPane.INFORMATION_MESSAGE);
                    } else {
                        JOptionPane.showMessageDialog(null, "Los datos de consulta no se han podido guardar ...", "Guardar", JOptionPane.ERROR_MESSAGE);
                    }

                    break;
                case IFrmHCGeneral.VIEW_CONSULTA:

                    if (OperacionesBD.modificar(getConsulta(consulta))) {
                        JOptionPane.showMessageDialog(null, "Datos de consulta guardados correctamente ...", "Guardar", JOptionPane.INFORMATION_MESSAGE);
                    } else {
                        JOptionPane.showMessageDialog(null, "Los datos de consulta no se han podido guardar ...", "Guardar", JOptionPane.ERROR_MESSAGE);
                    }

                    break;
//                case IFrmHCGeneral.NEW_EVOLUCION:
//                    break;
//                case IFrmHCGeneral.VIEW_EVOLUCION:
//                    break;
            }

        }
    }//GEN-LAST:event_btnGuardarConsultaActionPerformed

    private void txtCantidadMedicamentosDRActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtCantidadMedicamentosDRActionPerformed
    }//GEN-LAST:event_txtCantidadMedicamentosDRActionPerformed

    private void txtCantidadMedicamentosEActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtCantidadMedicamentosEActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtCantidadMedicamentosEActionPerformed

    private void txtFcActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtFcActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtFcActionPerformed

    private void txtTallaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtTallaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtTallaActionPerformed

    private void btnAgregarPatologiaDRActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarPatologiaDRActionPerformed
        int index = cmbPatologiaDR.getSelectedIndex();
        if (index != -1) {
            Patologia p = (Patologia) listPatologias.get(index);
            txtIndicacionDR.append(p.getIndicaciones() + "\n\n");
            txtMedicamentosDR.append(p.getMedicamentos() + "\n\n");
        }
    }//GEN-LAST:event_btnAgregarPatologiaDRActionPerformed

    private void txtCantidadMedicamentosDRKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtCantidadMedicamentosDRKeyTyped
        OperacionesVarias.ingresoSoloNumeros(evt);
    }//GEN-LAST:event_txtCantidadMedicamentosDRKeyTyped

    private void btnAgregarMedicamentoDRActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarMedicamentoDRActionPerformed
        int index = cmbMedicamentoDR.getSelectedIndex();
        if (index != -1) {
            MedicamentoComercial mc = (MedicamentoComercial) listMedicamentos.get(index);
            String texto1 = "", texto2 = "";
            StringTokenizer st = new StringTokenizer("" + mc, ")");
            int c = 0;
            while (st.hasMoreTokens()) {
                if (c == 0) {
                    texto1 = st.nextToken() + ")";
                } else {
                    texto2 = st.nextToken();
                }
                c++;
            }
            String s = "";
            int num = 0;
            try {
                num = Integer.parseInt(txtCantidadMedicamentosDR.getText());
            } catch (NumberFormatException e) {
            }

            txtMedicamentosDR.append(texto1 + "\n" + texto2 + " #" + num
                    + "(" + NumeroLetra.obtenerStringNumero(num) + ")\n\n");


        }
    }//GEN-LAST:event_btnAgregarMedicamentoDRActionPerformed

    private void tblEvolucionesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblEvolucionesMouseClicked
        if (tblEvoluciones.getRowCount() > 0) {
            int aux = tblEvoluciones.getSelectedRow();
            if (aux != -1) {
                evolucion = (Evolucion) listEvoluciones.get(aux);
                if (evt.getClickCount() == 2) {
                    setEditableEvolucion(true);
                    setEvolucion(evolucion);
                    btnNewEvolucion.setEnabled(true);
                    btnCerrarConsulta.setVisible(true);
                    setEstadoForm(IFrmHCGeneral.VIEW_EVOLUCION);
                } else if (evt.getClickCount() == 1) {
                    tblConsultasVisualizar.clearSelection();
                    tblEvolucionesVisualizar.clearSelection();
                }

            } else {
                JOptionPane.showMessageDialog(this, "Seleccione la evolucion ...", "Visualizar Evolucion", JOptionPane.WARNING_MESSAGE);
            }
        } else {
            JOptionPane.showMessageDialog(this, "No ha registrado ninguna evolucion ...", "Visualizar Evolucion", JOptionPane.WARNING_MESSAGE);
        }

    }//GEN-LAST:event_tblEvolucionesMouseClicked

    private void btnGuardarEvolucionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGuardarEvolucionActionPerformed

        int aux = JOptionPane.showConfirmDialog(this, "Los datos que se guardaran a continuacion no podran ser modificados:\n "
                + "¿Esta seguro de querer continuar?", "Guardar Evolucion", JOptionPane.YES_NO_OPTION);
        if (aux == 0) {

            switch (getEstadoForm()) {

//                case IFrmHCGeneral.NEW_CONSULTA:
//                    paciente.getConsultas().add(getConsulta(consulta));
//                    OperacionesBD.modificar(paciente);
//                    paciente = (Paciente) OperacionesBD.buscar("Paciente", "idPersona", "" + paciente.getIdPersona());
//                    consulta = paciente.getConsultas().get(paciente.getConsultas().size() - 1);
//                    setEstadoForm(IFrmHCGeneral.VIEW_CONSULTA);
//                    break;
//                case IFrmHCGeneral.VIEW_CONSULTA:
////                    OperacionesBD.modificar(consulta);
//
//                    for (int i = 0; i < paciente.getConsultas().size(); i++) {
//                        if (paciente.getConsultas().get(i).getIdConsulta() == consulta.getIdConsulta()) {
//                            paciente.getConsultas().set(i, getConsulta(consulta));
//                        }
//                    }
//                    OperacionesBD.modificar(paciente);
//                    break;
                case IFrmHCGeneral.NEW_EVOLUCION:

                    if (OperacionesBD.guardar(getEvolucion(evolucion))) {
                        setEstadoForm(IFrmHCGeneral.VIEW_EVOLUCION);
                        JOptionPane.showMessageDialog(null, "Datos de evolucion guardados correctamente ...", "Guardar", JOptionPane.INFORMATION_MESSAGE);
                    } else {
                        JOptionPane.showMessageDialog(null, "Los datos de evolucion no se han podido guardar ...", "Guardar", JOptionPane.ERROR_MESSAGE);
                    }
                    break;
                case IFrmHCGeneral.VIEW_EVOLUCION:

                    if (OperacionesBD.modificar(getEvolucion(evolucion))) {

                        JOptionPane.showMessageDialog(null, "Datos de evolucion guardados correctamente ...", "Guardar", JOptionPane.INFORMATION_MESSAGE);
                    } else {
                        JOptionPane.showMessageDialog(null, "Los datos de evolucion no se han podido guardar ...", "Guardar", JOptionPane.ERROR_MESSAGE);
                    }

                    break;
            }

        }

    }//GEN-LAST:event_btnGuardarEvolucionActionPerformed

    private void btnNewEvolucionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNewEvolucionActionPerformed
        newEvolucion();

    }//GEN-LAST:event_btnNewEvolucionActionPerformed

    private void btnAgregarMedicamentoEActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarMedicamentoEActionPerformed
        int index = cmbMedicamentoE.getSelectedIndex();
        if (index != -1) {
            MedicamentoComercial mc = (MedicamentoComercial) listMedicamentos.get(index);
            String texto1 = "", texto2 = "";
            StringTokenizer st = new StringTokenizer("" + mc, ")");
            int c = 0;
            while (st.hasMoreTokens()) {
                if (c == 0) {
                    texto1 = st.nextToken() + ")";
                } else {
                    texto2 = st.nextToken();
                }
                c++;
            }

            String s = "";
            int num = 0;
            try {
                num = Integer.parseInt(txtCantidadMedicamentosE.getText());
            } catch (NumberFormatException e) {
            }

            txtMedicamentosE.append(texto1 + "\n" + texto2 + " #" + num
                    + "(" + NumeroLetra.obtenerStringNumero(num) + ")\n\n");




        }
    }//GEN-LAST:event_btnAgregarMedicamentoEActionPerformed

    private void btnAgregarPatologiaEActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarPatologiaEActionPerformed
        int index = cmbPatologiaE.getSelectedIndex();
        if (index != -1) {
            Patologia p = (Patologia) listPatologias.get(cmbPatologiaE.getSelectedIndex());
            txtIndicacionesE.append(p.getIndicaciones() + "\n\n");
            txtMedicamentosE.append(p.getMedicamentos() + "\n\n");
        }
    }//GEN-LAST:event_btnAgregarPatologiaEActionPerformed

    private void txtImcFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtImcFocusGained
    }//GEN-LAST:event_txtImcFocusGained

    private void txtPesoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPesoKeyTyped
        OperacionesVarias.ingresoSoloNumeros(evt);
    }//GEN-LAST:event_txtPesoKeyTyped

    private void txtTallaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtTallaKeyTyped
        OperacionesVarias.ingresoSoloNumeros(evt);
    }//GEN-LAST:event_txtTallaKeyTyped

    private void btnViewDatosPersonalesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnViewDatosPersonalesActionPerformed
        iFrmDatosPaciente FrDatosPaciente = new iFrmDatosPaciente(paciente);
        frmPrincipal.dskpPrincipal.add(FrDatosPaciente);
        FrDatosPaciente.setVisible(true);
        OperacionesVarias.centrar(FrDatosPaciente);
    }//GEN-LAST:event_btnViewDatosPersonalesActionPerformed

    private void txtImcActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtImcActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtImcActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        iFrmCertificadoMedico FrCmedico = new iFrmCertificadoMedico(paciente);
        frmPrincipal.dskpPrincipal.add(FrCmedico);
        FrCmedico.toFront();
        FrCmedico.setVisible(true);
        OperacionesVarias.centrar(FrCmedico);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void txtTallaFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtTallaFocusLost
        txtImc.setText("" + calcularIMC(txtTalla.getText(), txtPeso.getText()));
    }//GEN-LAST:event_txtTallaFocusLost

    private void txtFcKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtFcKeyTyped
        OperacionesVarias.ingresoSoloNumeros(evt);
    }//GEN-LAST:event_txtFcKeyTyped

    private void txtFrKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtFrKeyTyped
        OperacionesVarias.ingresoSoloNumeros(evt);
    }//GEN-LAST:event_txtFrKeyTyped

    private void txtTemperaturaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtTemperaturaKeyTyped
        OperacionesVarias.ingresoSoloNumeros(evt);
    }//GEN-LAST:event_txtTemperaturaKeyTyped

    private void txtSat02KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSat02KeyTyped
        OperacionesVarias.ingresoSoloNumeros(evt);
    }//GEN-LAST:event_txtSat02KeyTyped

    private void txtPsicoexpresivaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPsicoexpresivaKeyTyped
        OperacionesVarias.ingresoSoloLetras(evt);
    }//GEN-LAST:event_txtPsicoexpresivaKeyTyped

    private void txtSomatoexpresivaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtSomatoexpresivaKeyTyped
        OperacionesVarias.ingresoSoloLetras(evt);
    }//GEN-LAST:event_txtSomatoexpresivaKeyTyped

    private void btnExamenesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExamenesActionPerformed
        iFrmExamenes examenes = new iFrmExamenes(consulta);
        frmPrincipal.dskpPrincipal.add(examenes);
        OperacionesVarias.centrar(examenes);

    }//GEN-LAST:event_btnExamenesActionPerformed

    private void tblConsultasVisualizarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblConsultasVisualizarMouseClicked
        if (tblConsultasVisualizar.getRowCount() > 0) {
            int aux = tblConsultasVisualizar.getSelectedRow();
            if (aux != -1) {
                consultaVisualizar = listConsultasVisualizar.get(aux);
                Consulta consul = consultaVisualizar.getConsulta();
                if (evt.getClickCount() == 2) {

                    setConsulta(consul);
                    setEditable(false);
                    agregarPaneles();
                    btnCerrarConsulta.setVisible(true);

                } else if (evt.getClickCount() == 1) {
                    cargarEvolucionesVisualizar();
                    tblConsultas.clearSelection();
                    tblEvoluciones.clearSelection();
                    btnExamenes.setEnabled(false);
                }

            } else {
                JOptionPane.showMessageDialog(this, "Seleccione la consulta ...", "Visualizar Consulta", JOptionPane.WARNING_MESSAGE);
            }
        } else {
            JOptionPane.showMessageDialog(this, "No ha registrado ninguna consulta ...", "Visualizar Consulta", JOptionPane.WARNING_MESSAGE);
        }

    }//GEN-LAST:event_tblConsultasVisualizarMouseClicked

    private void mnConsultaVisualizacionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnConsultaVisualizacionActionPerformed
        int index = tblConsultas.getSelectedRow();
        if (index != -1) {
            IFrmCompartirConsultas cc = new IFrmCompartirConsultas((Consulta) listConsultas.get(index));
            frmPrincipal.dskpPrincipal.add(cc);
            OperacionesVarias.centrar(cc);

        }
    }//GEN-LAST:event_mnConsultaVisualizacionActionPerformed

    private void tblEvolucionesVisualizarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblEvolucionesVisualizarMouseClicked
        if (tblEvolucionesVisualizar.getRowCount() > 0) {
            int aux = tblEvolucionesVisualizar.getSelectedRow();
            if (aux != -1) {
                Evolucion evolu = (Evolucion) listEvolucionesVisualizar.get(aux);
                if (evt.getClickCount() == 2) {
                    setEditableEvolucion(false);

                    setEvolucion(evolu);
                    btnCerrarConsulta.setVisible(true);
                    setEstadoForm(IFrmHCGeneral.VIEW_EVOLUCION);
                } else if (evt.getClickCount() == 1) {
                    tblConsultas.clearSelection();
                    tblEvoluciones.clearSelection();
                }
            } else {
                JOptionPane.showMessageDialog(this, "Seleccione la evolucion ...", "Visualizar Evolucion", JOptionPane.WARNING_MESSAGE);
            }
        } else {
            JOptionPane.showMessageDialog(this, "No ha registrado ninguna evolucion ...", "Visualizar Evolucion", JOptionPane.WARNING_MESSAGE);
        }

    }//GEN-LAST:event_tblEvolucionesVisualizarMouseClicked

    private String getDiagnosticoImprimir() {
        String str = "";
        int cont = 0;
        for (Diagnostico diag : consulta.getDiagnosticos()) {
            cont++;
            str += cont + ".- " + diag.getDiagnostico() + "     ";
            if (diag.getTipo() == 0) {
                str += "(PRESUNTIVO)\n\n";
            } else {
                str += "(DEFINITIVO)\n\n";
            }
        }

        return str;
    }

    private void btnImprimirHCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImprimirHCActionPerformed
        //Cargas Datos de Compañia
        ArrayList<Pyme> list = (ArrayList<Pyme>) OperacionesBD.listar("Pyme");
        Pyme pyme = null;
        if (!list.isEmpty()) {
            pyme = list.get(0);
        } else {
            pyme = new Pyme();
        }

        Map<String, Object> parametros = new HashMap<String, Object>();
        parametros.put("COMPANIA", pyme.getNombre());
        parametros.put("DIRECCION", pyme.getDireccion());
        parametros.put("TELEFONO", pyme.getTelefono());
        parametros.put("FAX", pyme.getFax());
        parametros.put("NHC", paciente.getNumeroHC());
        parametros.put("NUM_CONSUL", consulta.getNumConsul());
        parametros.put("DA_NOMBRE", paciente.getNombre());
        parametros.put("DA_APELLIDO", paciente.getApellido());
        parametros.put("DA_CEDULA", paciente.getCedula());
        parametros.put("DA_DIRECCION", paciente.getDireccion());
        parametros.put("DA_TELEFONO", paciente.getTelefono());
        parametros.put("DA_CELULAR", paciente.getCelular());
        parametros.put("DA_FNACE", paciente.getFechaNace());
        parametros.put("DA_EDAD", Persona.calcularAnos(paciente.getFechaNace()));
        parametros.put("DA_LNACE", paciente.getLugarNace());
        parametros.put("DA_LRESIDE", paciente.getLugarResi());
        parametros.put("DA_INSTRUCCION", paciente.getInstruccion());
        parametros.put("DA_PROFECCION", paciente.getProfeccion());
        parametros.put("DA_OCUPACION", paciente.getOcupacion());
        parametros.put("DA_RAZA", paciente.getRaza());
        parametros.put("DA_ESTADOCIVIL", paciente.geteCivil());
        parametros.put("DA_GRUPOS", paciente.gettSangre());
        parametros.put("DA_SEGURO", paciente.getSeguro());
        parametros.put("AN_MOTIVO_CONSULTA", txtMotivoConsulta.getText());
        parametros.put("AN_ENFERMEDAD_ACTUAL", consulta.getEnfermedadActual());
        parametros.put("AN_ANTECEDENTES_PERSONALES", consulta.getAntecedent_Person());
        parametros.put("AN_ANTECEDENTES_FAMILIARES", consulta.getAntecedent_Fami());
        parametros.put("EF_TA", consulta.getExamenFisico().gettA());
        parametros.put("EF_FC", consulta.getExamenFisico().getfC());
        parametros.put("EF_FR", consulta.getExamenFisico().getfR());
        parametros.put("EF_T", consulta.getExamenFisico().getTemperatura() + " " + cmbTemperatura.getSelectedItem().toString());
        parametros.put("EF_SAT02", consulta.getExamenFisico().getSat02());
        parametros.put("EF_LLENADO_CAPILAR", consulta.getExamenFisico().getLlenadocapilar());
        parametros.put("EF_GLICEMIA", consulta.getExamenFisico().getGlicemia());
        parametros.put("EF_PESO", consulta.getExamenFisico().getPeso());
        parametros.put("EF_TALLA", consulta.getExamenFisico().getTalla());
        parametros.put("EF_IMC", txtImc.getText());
        parametros.put("EF_BIOTIPO_CONST", consulta.getExamenFisico().getBiotipoConst());
        parametros.put("EF_ESTADO_NUTRI", consulta.getExamenFisico().getEstadoNutricional());
        parametros.put("EF_SOMATOEXPRESIVA", consulta.getExamenFisico().getSomatoexpresiva());
        parametros.put("EF_PSICOEXPRESIVA", consulta.getExamenFisico().getPsicoexpresiva());
        parametros.put("D_DIAGNOSTICO", getDiagnosticoImprimir());
        parametros.put("D_ANEXOS", consulta.getAnexos());
        parametros.put("D_MEDICAMENTOS", consulta.getRecetaMedica().getMedicamentos());
        parametros.put("D_INDICACIONES", consulta.getRecetaMedica().getIndicaciones());

        ArrayList aux = new ArrayList();
        aux.add("aux");

        try {
            JasperReport reporte = (JasperReport) JRLoader.loadObject(getClass().getResource("/modulos/reportes/historiaclinica/HistoriaClinica.jasper"));

//            JasperReport reporte = (JasperReport) JRLoader.loadObject("src/modulos/reportes/historiaclinica/HistoriaClinica.jasper");
            JasperPrint jasperPrint = JasperFillManager.fillReport(reporte, parametros, new JRBeanCollectionDataSource(aux));
            JasperViewer vista = new JasperViewer(jasperPrint, false);
            vista.setSize(frmPrincipal.dskpPrincipal.size());
            vista.setVisible(true);
        } catch (JRException ex) {
            Logger.getLogger(iFrmAgenda.class.getName()).log(Level.SEVERE, null, ex);
        }


    }//GEN-LAST:event_btnImprimirHCActionPerformed

    private void btnImprimirRecetaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImprimirRecetaActionPerformed

        Map<String, Object> parametros = new HashMap<String, Object>();
        parametros.put("NOMBRE", paciente);
        parametros.put("MEDICAMENTOS", consulta.getRecetaMedica().getMedicamentos());
        parametros.put("INDICACIONES", consulta.getRecetaMedica().getIndicaciones());
        ArrayList aux = new ArrayList();
        aux.add("aux");
        try {

            JasperReport reporte = (JasperReport) JRLoader.loadObject(getClass().getResource("/modulos/reportes/receta/Receta.jasper"));
            JasperPrint jasperPrint = JasperFillManager.fillReport(reporte, parametros, new JRBeanCollectionDataSource(aux));
            JasperViewer vista = new JasperViewer(jasperPrint, false);
            vista.setSize(frmPrincipal.dskpPrincipal.size());
            vista.setVisible(true);
        } catch (JRException ex) {
            Logger.getLogger(iFrmAgenda.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btnImprimirRecetaActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAddMotivoConsul;
    private javax.swing.JButton btnAgregarDR;
    private javax.swing.JButton btnAgregarMedicamentoDR;
    private javax.swing.JButton btnAgregarMedicamentoE;
    private javax.swing.JButton btnAgregarMotivoConsulta;
    private javax.swing.JButton btnAgregarPatologiaDR;
    private javax.swing.JButton btnAgregarPatologiaE;
    private javax.swing.JButton btnCerrarConsulta;
    private javax.swing.JButton btnExamenes;
    private javax.swing.JButton btnGuardarConsulta;
    private javax.swing.JButton btnGuardarEvolucion;
    private javax.swing.JButton btnImprimirEvolucion;
    private javax.swing.JButton btnImprimirHC;
    private javax.swing.JButton btnImprimirReceta;
    private javax.swing.JButton btnNewConsulta;
    private javax.swing.JButton btnNewEvolucion;
    private javax.swing.JButton btnViewDatosPersonales;
    private javax.swing.JComboBox cmbBiotipoConst;
    private javax.swing.JComboBox cmbEstadoNutri;
    private javax.swing.JComboBox cmbMedicamentoDR;
    private javax.swing.JComboBox cmbMedicamentoE;
    private static javax.swing.JComboBox cmbMotivoConsulta;
    private javax.swing.JComboBox cmbPatologiaDR;
    private javax.swing.JComboBox cmbPatologiaE;
    private javax.swing.JComboBox cmbTemperatura;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JPopupMenu jPopupMenu1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane13;
    private javax.swing.JScrollPane jScrollPane14;
    private javax.swing.JScrollPane jScrollPane15;
    private javax.swing.JScrollPane jScrollPane16;
    private javax.swing.JScrollPane jScrollPane17;
    private javax.swing.JScrollPane jScrollPane18;
    private javax.swing.JScrollPane jScrollPane19;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane20;
    private javax.swing.JScrollPane jScrollPane21;
    private javax.swing.JScrollPane jScrollPane22;
    private javax.swing.JScrollPane jScrollPane23;
    private javax.swing.JScrollPane jScrollPane24;
    private javax.swing.JScrollPane jScrollPane25;
    private javax.swing.JScrollPane jScrollPane26;
    private javax.swing.JScrollPane jScrollPane28;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JTextField jTextField8;
    private javax.swing.JMenuItem mnConsultaVisualizacion;
    private javax.swing.JPanel pnlAnamnesis;
    private javax.swing.JPanel pnlBotones;
    private javax.swing.JPanel pnlConsultas;
    private javax.swing.JPanel pnlDiagReceta;
    private javax.swing.JPanel pnlDiagnosticos;
    private javax.swing.JPanel pnlEmcabezado;
    private javax.swing.JPanel pnlEvolucion;
    private javax.swing.JPanel pnlExamenFisico;
    private javax.swing.JPanel pnlId;
    private javax.swing.JPanel pnlId1;
    private javax.swing.JPanel pnlId10;
    private javax.swing.JPanel pnlId11;
    private javax.swing.JPanel pnlId12;
    private javax.swing.JPanel pnlId13;
    private javax.swing.JPanel pnlId14;
    private javax.swing.JPanel pnlId15;
    private javax.swing.JPanel pnlId17;
    private javax.swing.JPanel pnlId2;
    private javax.swing.JPanel pnlId3;
    private javax.swing.JPanel pnlId4;
    private javax.swing.JPanel pnlId5;
    private javax.swing.JPanel pnlId6;
    private javax.swing.JPanel pnlId7;
    private javax.swing.JPanel pnlId8;
    private javax.swing.JPanel pnlId9;
    private javax.swing.JTable tblConsultas;
    private javax.swing.JTable tblConsultasVisualizar;
    private javax.swing.JTable tblEvoluciones;
    private javax.swing.JTable tblEvolucionesVisualizar;
    private javax.swing.JTabbedPane tpnlPaneles;
    private javax.swing.JTextArea txtAnexoDR;
    private javax.swing.JTextArea txtAntecedentFami;
    private javax.swing.JTextArea txtAntecedentPerson;
    private javax.swing.JTextField txtCantidadMedicamentosDR;
    private javax.swing.JTextField txtCantidadMedicamentosE;
    private javax.swing.JTextField txtEdadPacient;
    private javax.swing.JTextArea txtEnfermedadActual;
    private javax.swing.JTextArea txtEnfermedadActual1;
    private javax.swing.JTextArea txtEnfermedadActual10;
    private javax.swing.JTextArea txtEnfermedadActual11;
    private javax.swing.JTextArea txtEnfermedadActual12;
    private javax.swing.JTextArea txtEnfermedadActual14;
    private javax.swing.JTextArea txtEnfermedadActual2;
    private javax.swing.JTextArea txtEnfermedadActual3;
    private javax.swing.JTextArea txtEnfermedadActual4;
    private javax.swing.JTextArea txtEnfermedadActual5;
    private javax.swing.JTextArea txtEnfermedadActual6;
    private javax.swing.JTextArea txtEnfermedadActual7;
    private javax.swing.JTextArea txtEnfermedadActual8;
    private javax.swing.JTextArea txtEnfermedadActual9;
    private javax.swing.JTextArea txtEvolucion;
    private javax.swing.JTextField txtFc;
    private javax.swing.JLabel txtFecha;
    private javax.swing.JLabel txtFechaEvolucion;
    private javax.swing.JTextField txtFr;
    private javax.swing.JTextField txtGlicemia;
    private javax.swing.JLabel txtHora;
    private javax.swing.JLabel txtHoraEvolucion;
    private javax.swing.JTextField txtImc;
    private javax.swing.JTextArea txtIndicacionDR;
    private javax.swing.JTextArea txtIndicacionesE;
    private javax.swing.JTextField txtLlenadoCapilar;
    private javax.swing.JTextArea txtMedicamentosDR;
    private javax.swing.JTextArea txtMedicamentosE;
    private javax.swing.JTextField txtMotivoConsulta;
    private javax.swing.JTextField txtNomPacient;
    private javax.swing.JTextField txtNumConsulta;
    private javax.swing.JTextField txtNumHC;
    private javax.swing.JTextField txtPeso;
    private javax.swing.JTextField txtPsicoexpresiva;
    private javax.swing.JTextField txtSat02;
    private javax.swing.JTextField txtSomatoexpresiva;
    private javax.swing.JTextField txtTa;
    private javax.swing.JTextField txtTalla;
    private javax.swing.JTextField txtTemperatura;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the estadoForm
     */
    public int getEstadoForm() {
        return estadoForm;
    }

    /**
     * @param estadoForm the estadoForm to set
     */
    public void setEstadoForm(int estadoForm) {
        this.estadoForm = estadoForm;
    }
}
